Jamf Server logs issue on windows server

dhausman
Contributor

Is anyone having trouble with the Jamf Server logs not actually logging?   I have a support ticket open (CS0951135) for this because I think the log4j2.xml file is not setup correct, it was broken before in 10.45, but stuff has changed in that configuration file and it is even more broken in 10.46.

 

I am in a windows server environment, and installed using the jamf windows installer. I am installing it on the D drive on my Jamf server and not on my C drive, but I am using the installer to do all of this, so not doing anything special.  Is there anyone else out there with windows using not the c drive for Jamf with this issue?

1 ACCEPTED SOLUTION

cbrewer
Valued Contributor II

Here is what seems to work...

Change your loggingDirectory line to this:
Property name="loggingDirectory">C:/Program Files/JSS/Logs</Property>

 

Change all of the fileName and filePattern paths in your RollingFile lines to look like this:

<RollingFile name="JAMFCMFILE" fileName="${loggingDirectory}/JAMFChangeManagement.log" filePattern="${loggingDirectory}/JAMFChangeManagement.log.%i">

View solution in original post

7 REPLIES 7

cbrewer
Valued Contributor II

Yes - broken here as well and on multiple servers. Logs are being written to C:\Program Files\JSS\Logs\Library\JSS\Logs. I have a support case open with Jamf. It seems they messed up the log4j2.xml file. The loggingDirectory property is wrong and possibly the paths to the actual log files as well.

cbrewer
Valued Contributor II

Here is what seems to work...

Change your loggingDirectory line to this:
Property name="loggingDirectory">C:/Program Files/JSS/Logs</Property>

 

Change all of the fileName and filePattern paths in your RollingFile lines to look like this:

<RollingFile name="JAMFCMFILE" fileName="${loggingDirectory}/JAMFChangeManagement.log" filePattern="${loggingDirectory}/JAMFChangeManagement.log.%i">

dhausman
Contributor

I do have a support case open. I fixed mine the same way as you. They were going to verify they could replicate the issue and get engineering involved.

es-742859
New Contributor

@cbrewerthanks for providing a fix.

Apparently the original file patterns were saved in the log4j.properties file.  Hopefully we do not lose log file changes on the next upgrade.

Below are the first few lines of log4j.properties file:

! Warning! Changes made to this file will not necessarily make it into customer's JSS
! instances, as some installers will overwrite the log4j.properties file

! An appender for file-based Change Management logging
log4j.appender.JAMFCMFILE=org.apache.log4j.RollingFileAppender
log4j.appender.JAMFCMFILE.File=F:\\Program Files\\JSS\\Logs\\JAMFChangeManagement.log
log4j.appender.JAMFCMFILE.MaxFileSize=10MB
log4j.appender.JAMFCMFILE.MaxBackupIndex=10
log4j.appender.JAMFCMFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.JAMFCMFILE.layout.ConversionPattern=%m%n
log4j.appender.JAMFCMFILE.encoding=UTF-8

! An appender for Syslog-based Change Management logging
log4j.appender.JAMFCMSYSLOG=org.apache.log4j.net.SyslogAppender
log4j.appender.JAMFCMSYSLOG.syslogHost=127.0.0.1:514
log4j.appender.JAMFCMSYSLOG.layout=org.apache.log4j.PatternLayout
log4j.appender.JAMFCMSYSLOG.layout.ConversionPattern=%m%n
log4j.appender.JAMFCMSYSLOG.Facility=local2

! The basic appender definitions for com.jamfsoftware.jss classes
log4j.appender.JAMF=org.apache.log4j.RollingFileAppender
log4j.appender.JAMF.File=F:\\Program Files\\JSS\\Logs\\JAMFSoftwareServer.log
log4j.appender.JAMF.MaxFileSize=100MB
log4j.appender.JAMF.MaxBackupIndex=10
log4j.appender.JAMF.layout=org.apache.log4j.PatternLayout
log4j.appender.JAMF.layout.ConversionPattern=%d{ISO8601} [%-5p] [%-11.11t] [%-25.25c{1}] - %m%n
log4j.appender.JAMF.encoding=UTF-8

We have recently upgraded JAMF to version 10.48.2-t1689860131 and lost the server logs again.

My previous post was cryptic, so I will clarify what worked for us since we have JAMF installed on a Windows Server using drive F:\ similar to OP @dhausman.

To get the logs to work again we modified the log4j2.xml file located here:
F:\Program Files\JSS\Tomcat\webapps\ROOT\WEB-INF\classes

We changed the loggingDirectory property
from: <Property name="loggingDirectory">${sys:log.dir:-/Library/JSS/Logs/}</Property>
to: <Property name="loggingDirectory">F:/Program Files/JSS/Logs/</Property>

We also removed all references to C:\Program Files\JSS\Logs\ so RollingFile entries should look similar to this:
<RollingFile name="JAMF" fileName="${loggingDirectory}JAMFSoftwareServer.log" filePattern="${loggingDirectory}JAMFSoftwareServer${archiveExtensionDateAndInterval}">

Make sure you save your changes and restart Tomcat.

dhausman
Contributor

After installing 10.48.2 things seem to just work for me using the windows installer.  I don't have to mess around with the log4j2.xml file any more. The recent installers fixed things by auto feeding the install path into the log config.

cbrewer
Valued Contributor II

I found that 10.48.0 and 10.48.2 Windows installers will keep your previous log4j2.xml if there is one. If you want it rewritten with a new/default one, you need to delete the file before running the upgrade. This almost seems like a bug, but I haven't opened a support case. Regardless, it does appear that Jamf is writing correct paths into the log4j2 file when it does create a new one now.