Skip to main content
Version: 1.5.x.x LTS

Logging

Log files

The log files of nevisMeta are stored in the following directory:

/var/opt/adnglassfish/nevismeta/<instancename>/logs/

nevismeta.log
Contains all log messages of nevisMeta.

server.log
Contains all log messages of the GlassFish container.

Configuration

Logging is configured by using the following command:

nevismeta config log

Logging layout patterns

The pattern of each in

<appender name="FILE" class="org.apache.log4j.RollingFileAppender">
<param name="File" value="/var/opt/adnglassfish/nevismeta/nevismeta/logs/nevismeta.log"/>
<param name="Encoding" value="UTF-8"/>
<param name="Append" value="true"/>
<param name="MaxFileSize" value="10MB"/>
<param name="MaxBackupIndex" value="10"/>
<param name="Threshold" value="TRACE"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d\{ISO8601\} %20.20C\{1\}:%-4.5L \[%-8.8X\{LoginID\}\] (%t) %-6.6p%x%X\{indent\}%m%n"/>
</layout>
</appender>

The above example will prepend log lines with (in that order): a date/time timestamp (%d), the class name (%C{1}), the line number(%-4.5L), and the name of the thread (%t). It will also indent traces (%X{indent}).

Important trace groups
The following table describes the most important trace groups:

Log categoryDescription
ch.adnovumTracing of nevisMeta core code
ch.nevisTracing of Nevis subcomponents such as Ninja
ch.nevis.nevismetaTracing of nevisMeta code
ch.nevis.perfRequest performance report on trace level INFO
com.sun.jerseyDebugging of REST interface code
nevismeta.propertiesConfiguration facility, configuration dump
http.requestDebugging of HTTP requests (disabled by default)
http.responseDebugging of HTTP responses (disabled by default)
http.bodyDebugging of HTTP requests body (disabled by default)
http.sessionDebugging of HTTP sessions (disabled by default)
http.timeDebugging of HTTP timings (disabled by default)
jcan.OpTrace information about SOAP method invocations (set to INFO by default)

Syslog

May forward log messages to a local or remote syslog host by configuring a dedicated appender (in addition to the existing file appenders or by replacing them).

NevisSyslogAppender
The original SyslogAppender delivered with log4j truncates messages (1024 bytes maximal length). This is due to the message size limit of 1024 bytes defined in RFC 3164.

As of RFC 5424 (obsoleting RFC 3164), syslog servers are usually able to receive messages with more than 1024 bytes and this limit can be ignored in most cases. To enable sending oversized syslog messages, nevisMeta comes with a custom log4j syslog appender which ignores the 1024 bytes limit.

With the exception of the removed length limit checks, the NevisSyslogAppender is an exact copy of the official log4j SyslogAppender.

The NevisSyslogAppender can be configured via log4j configuration by defining an appender which references the class ch.nevis.commons.log4j.net.NevisSyslogAppender.

Example:

    <appender name="SYSLOG_SERVER" class="ch.nevis.commons.log4j.net.NevisSyslogAppender">
<param name="SyslogHost" value="loghost.zh.adnovum.ch:514" />
<param name="Facility" value="LOCAL3" />
<param name="Threshold" value="INFO" />
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="%d\{ISO8601\} %20.20C\{1\}:%-4.5L \[%-8.8X\{LoginID\}\] (%t) %-
6.6p%x%X\{indent\}%m%n"/>
</layout>
</appender>

<root>
<priority value="WARN" />
<appender-ref ref="FILE"/>
<appender-ref ref="SYSLOGS_SERVER"/>
</root>