Skip to main content

Log properties configuration options

This article includes information about configuring the log properties file. You can skip this section if there is no need to change the logging configuration.

Default logging options

The log properties file is specified using Autoenrollment Configuration utility Log Properties setting. The following shows the contents of the default properties file:

# A line starting with # is a comment and ignored.
# Define with log-level (DEBUG, INFO, WARN, or ERROR) and appender name
log4cpp.rootCategory=INFO, DAILY
# Configured appender type
log4cpp.appender.DAILY=DailyRollingFileAppender
# File name and path
# AE Server requires write permission, and directory must exist
log4cpp.appender.DAILY.fileName=C:\Program Files\DigiCert\AEServer\logs\AEServer.log
# Max days to keep the old log files
log4cpp.appender.DAILY.maxDaysKeep=30
# Output pattern (see http://log4cpp.sourceforge.net/#faq for format details)
log4cpp.appender.DAILY.layout=PatternLayout
log4cpp.appender.DAILY.layout.ConversionPattern=%d{%Y-%m-%d %H:%M:%S} %-5p [%t] %m%n
tabla 1. Log property details

Property key

Description

log4cpp.rootCategory

Specifies log level and name to use for the configuration.

The value is in following format:

<log_level>, <logger_name>

  • log_level describes the logging level.

  • This can be set to DEBUG, INFO, WARN, or ERROR, with DEBUG log level being the most verbose.

  • Setting the level to DEBUG will increase the amount of log output significantly, so should be careful when using this in production environment.

  • logger_name describes the name of the configuration, which is also used in other property keys. This can be any value, but DAILY is used as default.

log4cpp.appender.<logger_name>

Specifies the type of log appender.

Currently DailyRollingFileAppender and SyslogAppender are supported. Using DailyRollingFileAppender appender will allow the log file to rotate daily at 00:00 (local time) every day, creating a log file with name <log_filename>.yyyy-MM-dd.

Nota

Log file rotation occurs only when there is a new log entry after 00:00 (local time).

Using SyslogAppender appender will allow the Autoenrollment server to dump log messages to the configured syslog server. See Configuring Autoenrollment Server for Syslog for more details about this appender.

log4cpp.appender.<logger_name>.fileName

Specifies the log file name with path.

Default location will be <installation directory>\AEServer.log. This will change depending on where Autoenrollment Server was installed.

Nota

  • The log file directory must exist.

  • Autoenrollment service requires write permission for the file.

log4cpp.appender.<logger_name>.maxDaysKeep

Specifies the maximum days to keep the log files.

The log entries exceeding the max days will be deleted from the file system.

log4cpp.appender.<logger_name>.layout

Specifies the log layout class.

Currently only PatternLayout is supported.

log4cpp.appender.<logger_name>.ConversionPattern

Specifies the output format of the logs.

See http://log4cpp.sourceforge.net/#faq for details about possible format characters for the custom log messages.

The default log format is set as “<Date{yyyy-mm-dd}> <Time{hh:mm:ss}> <LogLevel> [<TheadID>] <LogMessage>”.

Example below:

2021-09-22 04:15:28 INFO [6176] Using CA backend at pki-ws.symauth.com:443


Nota

  • Any modifications in the file contents will only become effective after restarting the Autoenrollment service.

  • Lines starting with # are ignored.

Use syslog for logging

Autoenrollment Server can use syslog for logging output by using the Autoenrollment Configuration Log Properties settings. Change the contents of the logger.properties file or change the target property file path to enable logging to syslog.

The sample syslog properties file can be found as syslogger_sample.properties in the installation directory of the Autoenrollment Server. The following shows the contents of the sample:

 # A line starting with # is a comment and ignored.
# Define with log-level (DEBUG, INFO, WARN, or ERROR) and appender name
log4cpp.rootCategory=INFO, SYSLOG
# Configured appender type
log4cpp.appender.SYSLOG=SyslogAppender
# Remote syslog server IP address
log4cpp.appender.SYSLOG.syslogHost=192.168.1.1
# Remote syslog server port number
log4cpp.appender.SYSLOG.portNumber=514
# Syslog facility number
log4cpp.appender.SYSLOG.facility=1
# Output pattern (see http://log4cpp.sourceforge.net/#faq for format details)
log4cpp.appender.SYSLOG.layout=PatternLayout
log4cpp.appender.SYSLOG.layout.ConversionPattern=[AESRV]: %d{%Y-%m-%d %H:%M:%S} %-5p [%t] %m%n
tabla 2. Details about each syslog property

Property key

Description

log4cpp.rootCategory

Sets logger_name as SYSLOG by default.

log4cpp.appender.<logger_name>

The value must be SyslogAppender to use syslog.

log4cpp.appender.<logger_name>.syslogHost

Specifies the remote syslog server IP address.

Nota

The remote syslog server must be accessible from the machine where Autoenrollment Server is installed.

log4cpp.appender.<logger_name>.portNumber

Specifies the remote syslog server port number.

log4cpp.appender.<logger_name>.facility

Specifies the remote syslog server facility number.

Default value is 1 (user-level messages).

log4cpp.appender.<logger_name>.layout

Specifies the log layout class.

Currently only PatternLayout is supported.

log4cpp.appender.<logger_name>.ConversionPattern

The default log format is set as “[AESRV]: <Date{yyyy-mm-dd}> <Time{hh:mm:ss}> <LogLevel> [<ThreadID>] <LogMessage>”. Every log message is intentionally prepended with [AESRV]: string, to differentiate Autoenrollment server logs from other logs. The following shows an example:

[AESRV]: 2021-09-22 04:15:28 INFO [6176] Service started, waiting for requests.