By default the PaperCut Application Server will create all it’s log data in
[app dir]/server/logs/server.log. However sometimes you need to have the logs go to a different place, for example a centralised enterprise logging service such as syslog. PaperCut uses a sophisticated logging facility build around the standard log4j library. This article provides a simple example of how to re-configure PaperCut to log to the syslog facility simply by re-configuring log4j.
PaperCut uses the log4j library to generate most of its log messages. This means that you can re-configure the logger to put the data in a different location or push it to a logging service by using a different log4j appender. A detailed discussion of how to do this correctly is beyond the scope of this article as it will vary depending on the customer requirements and site specifics. Please refer to the Apacher log4j documention at https://logging.apache.org/log4j. The following simple example for syslog included below shows the basic process:
- After each PaperCut application server upgrade these log4j settings are reset to the original defaults.
- PaperCut strongly recommend backing up your log configuration file before and after making any changes. NB These should archived outside the PaperCut install directory as the files are overwritten during the PaperCut upgrade process
- PaperCut, particularly in debug mode, can produce a lot of logging of data and you should consider this when configuring the logs
- The PaperCut print provider logs located on the PaperCut secondary servers cannot be relocated or redirected.
To configure the PaperCut server log setup update the file
to create a new logging configuration. For example.
1. Add a stanza for a new logging destination:
# Log to local syslog server log4j.appender.SYSLOG=org.apache.log4j.net.SyslogAppender log4j.appender.SYSLOG.Threshold=INFO # See https://en.wikipedia.org/wiki/Syslog#Facility for a list of allowed values log4j.appender.SYSLOG.Facility=LOCAL3 log4j.appender.SYSLOG.syslogHost=localhost log4j.appender.SYSLOG.layout=org.apache.log4j.PatternLayout log4j.appender.SYSLOG.layout.ConversionPattern=[%-5p] %c - %m%n # Customise to suit
2. Then update the list of active loggers
# Logs to file and syslog log4j.rootLogger=error, file, SYSLOG
Now restart the PaperCut application server.
It is suggested that PaperCut continues to log to it’s default file for troubleshooting purposes, even if a remote logging service is configured as well. This will make it easier to supply PaperCut support with logs when troubleshooting.
Keywords: logs, logs