Introduction / FirstSpirit Server configuration / Configuration files (FirstSpirit Server) / Logging configuration (fs-logging.xml) / Logging configuration (fs-logging.conf)

Logging configuration (fs-logging.conf) - Log4j 1

Table of contents

The file fs-logging.conf is located in the FirstSpirit Server subdirectory conf and contains important configuration settings for the log outputs. It must be adapted, if necessary.

Changes to the configuration file fs-logging.conf can be carried out via FirstSpirit ServerMonitoring (see Logging). The changes are subsequently written into the configuration file and updated on the server. If access to the file system is available, fs-logging.conf can also be directly changed via the configuration file.

Occurred errors and info messages are transferred to the logging framework (e. g. “Log4j”, “Logback”). The log outputs can be categorised via the framework. The configuration example shows, e.g., the categories DEBUG, INFO and ERROR. It is, however, also possible to configure additional categories (e.g. FATAL, WARN). The two stages ALL and OFF, which either deactivate the logging completely (OFF) or output all messages unfiltered (ALL), are an exception.

Further logging files are included in the FirstSpirit scope of installation. Activation of a certain logging configuration as well as filtering and output type can be configured via ServerMonitoring during runtime (see Logging).

Configuration files should have the syntax fs-logging.myLogging.conf to ensure they are recognised by FirstSpirit and activated via ServerMonitoring.

log4j.rootCategory=INFO, fs
 
log4j.logger.org.eclipse.jetty=WARN
log4j.logger.org.apache.jasper=WARN
log4j.logger.org.apache.log4j.jmx=ERROR
log4j.logger.de.espirit.firstspirit.server.ExecutionManagerImpl=INFO
log4j.logger.org.apache.commons.httpclient=INFO
 
# fs
log4j.appender.fs=de.espirit.firstspirit.server.logging.FSAppender
log4j.appender.fs.consoleLogging=false
log4j.appender.fs.plainLogging=false
log4j.appender.fs.datedLogging=true
log4j.appender.fs.maxFileSize=5MB
log4j.appender.fs.buffer=8192
log4j.appender.fs.flushCycle=10

For further information on the logging framework “log4j” and a parameter description see https://logging.apache.org/log4j/1.2/manual.html

Details of paths under Windows: If a file is to be specified for output of the log files, the path must be given as follows (path details separated by /):
log4j.appender.file.File=D:/FirstSpirit5/log/err.log

Example:

# file
log4j.rootCategory=ERROR, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=D:/FirstSpirit5/log/err.log
log4j.appender.file.MaxFileSize=5MB
log4j.appender.file.MaxBackupIndex=5
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%-5p %d (%c) %m%n

Parameters for selecting the logging method

The configuration parameters described below are used for selecting the logging method and can be activated/deactivated independently of each other. Permitted values are 0 for “deactive” and 1 for “active”.

log4j.appender.fs.consoleLogging

Toggle for log message output to the console (command line/Shell) from which FirstSpirit has been started.

log4j.appender.fs.plainLogging

Toggle for log message output as plain text in a file. The log file for the server always has the name fs-server.log.

log4j.appender.fs.datedLogging

Toggle for log message output as plain text in a file. The date of the first entry is always added to the log file name, e.g. fs-server.20070322_100436.log (with first entry on March 22, 2007 at 10:04:36 a.m.). Activate this parameter to search within the ServerMonitoring log files.

Parameters for maximum file size configuration

log4j.appender.fs.maxFileSize

This parameter influences the max. permitted log file size. The size is stated in Bytes. Default value is 5 MB.

Configuration of the log rotation

Depending on the logging method, a reset or rotation occurs if the max. permitted log file size has been achieved.

  1. If the parameter plainLogging has been activated and the parameter datedLoggingdeactivated, the current log file (e.g. fs-server.log) is renamed. The date of the first entry is added (e.g. fs-server.20070322_100436.log). The renamed file is subsequently compressed and the additional suffix .gz is added to the name. Meanwhile, further logging takes place in a newly created log file with the original name.
  2. If the parameter plainLogging has been deactivated and the parameter datedLoggingactivated, the current log file (e.g. fs-server.20070322_100436.log) is compressed and the additional suffix .gz is added to the name. Meanwhile, further logging takes place in a newly created log file (with new date extension).
  3. If the parameters plainLogging and datedLogging have both been activated, logging occurs in the log files with and without date extension. Rotation occurs similar to point 2 (the log file without date extension is simply reset).

Parameters for logging behaviour configuration

log4j.appender.fs.buffer

Influences the buffer size (in bytes) (default value: 8192 bytes) which should be used internally. The buffer accepts log messages and stores them until the buffer size has been reached. Only then are the messages written into the log file to avoid unnecessary and time-intensive write operations. When terminating the server, it is still written into the buffer even if the buffer size has not been reached.

log4j.appender.fs.flushCycle

Determines the maximum time (in seconds) between two write operations. If this time has elapsed, it is still written into the buffer even if the buffer size has not been reached.

Important Log messages which are amongst others relevant for debugging can be found not only in the file fs-server.log but also in the file fs-wrapper.log (see Logging).                                         

Configuration of the audit logging

The FirstSpirit logging can be enhanced by audit functions. This is documented within a separate area that can be found here: Audit logging in FirstSpirit.

Run level

When a FirstSpirit Server starts, information about the current run level is available.

The run levels are output in various locations:

  • as a log output in the fs-server.log or fs-wrapper.log file
  • as a value [number] in the ~FS/.fs.lock file

These run levels can indicate whether and/or when a server functionality is available:

  • SHUTDOWN (run level 0)
    The server has been shut down.
    Note: The ~FS/.fs.lock file is not available in this run level.
  • IN_PROGRESS (run level 20)
    The server is starting or being shut down; no functionalities are available with certainty.
  • CORE_STARTED (run level 40)
    The basic functionalities are available; the server can be accessed via the SOCKET port.
  • ROOT_WEBAPP_STARTED (run level 60)
    The server can now be accessed via the HTTP port as well.
  • CORE_WEBAPPS_STARTED (run level 80)
    The global web applications are available.
  • STARTED (run level 100)
    All FirstSpirit functionalities are available.

It is possible to respond via the API for example, in this run level (RunLevelAgent interface, de.espirit.firstspirit.agency package, FirstSpirit Access API).

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.5 | Data privacy