JBoss Community Archive (Read Only)

JBoss AS 7.1

Logging Configuration

Overview

The overall server logging configuration is represented by the logging subsystem. It consists of three notable parts: handler configurations, logger and the root logger declarations (aka log categories). Each logger does reference a handler (or set of handlers). Each handler declares the log format and output:

<subsystem xmlns="urn:jboss:domain:logging:1.0">
   <console-handler name="CONSOLE" autoflush="true">
       <level name="DEBUG"/>
       <formatter>
           <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
       </formatter>
   </console-handler>
   <periodic-rotating-file-handler name="FILE" autoflush="true">
       <formatter>
           <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>
       </formatter>
       <file relative-to="jboss.server.log.dir" path="server.log"/>
       <suffix value=".yyyy-MM-dd"/>
   </periodic-rotating-file-handler>
   <logger category="com.arjuna">
       <level name="WARN"/>
   </logger>
   [...]
   <root-logger>
       <level name="DEBUG"/>
       <handlers>
           <handler name="CONSOLE"/>
           <handler name="FILE"/>
       </handlers>
   </root-logger>
</subsystem>

Why is there a logging.properties file?

You may have noticed that there is a logging.properties file in the configuration directory. This logging configuration is used when the server boots up until the logging subsystem kicks in. If the logging subsystem is not included in your configuration, then this would act as the logging configuration for the entire server.

In the future this file may go away or be automatically generated from the logging subsystem. For most users this file should not be modified.

Note: If the logging.properties is not available during start there will be no logging until the logging subsystems kicks in, this is also the case if the configuration is damaged, the server might exit without any further message.

Default Log File Locations

Managed Domain

In a managed domain two types of log files do exist: Controller and server logs. The controller components govern the domain as whole. It's their responsibility to start/stop server instances and execute managed operations throughout the domain. Server logs contain the logging information for a particular server instance. They are co-located with the host the server is running on.

For the sake of simplicity we look at the default setup for managed domain. In this case, both the domain controller components and the servers are located on the same host:

Process

Log File

Host Controller

./domain/log/host-controller/boot.log

Process Controller

./domain/log/process-controller/boot.log

"Server One"

./domain/servers/server-one/log/boot.log

"Server One"

./domain/servers/server-one/log/server.log

"Server Three"

./domain/servers/server-three/log/boot.log

"Server Three"

./domain/servers/server-three/log/server.log

The server logs as you know it from previous JBoss AS versions are located in the servers subdirectory: I.e. ./domain/servers/server-three/log/server.log

Standalone Server 

The default log files for a standalone server can be found in the log subdirectory of the distribution:

Process

Log File

Server

./standalone/log/boot.log

Server

./standalone/log/server.log

Logging Subsystem Descriptions

root-logger

Defines the root logger for this log context.

Attribute

Description

Type

Allow Null

Expression Allowed

Access Type

Restart Required

Allowed Values

level

The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.

STRING

true

false

read-write

no-services

"ALL","CONFIG","DEBUG","ERROR","FATAL","FINE","FINER","FINEST","INFO","OFF","TRACE","WARN","WARNING"

filter

Defines a simple filter type.

OBJECT

true

false

read-write

no-services

"all","any","accept","change-level","deny","level","level-range","match","not","replace"

handlers

The Handlers associated with this Logger.

LIST

true

false

read-write

no-services

Any

logger

Defines a logger category.

Attribute

Description

Type

Allow Null

Expression Allowed

Access Type

Restart Required

Allowed Values

level

The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.

STRING

true

false

read-write

no-services

"ALL","CONFIG","DEBUG","ERROR","FATAL","FINE","FINER","FINEST","INFO","OFF","TRACE","WARN","WARNING"

filter

Defines a simple filter type.

OBJECT

true

false

read-write

no-services

"all","any","accept","change-level","deny","level","level-range","match","not","replace"

handlers

The Handlers associated with this Logger.

LIST

true

false

read-write

no-services

Any

use-parent-handlers

Specifies whether or not this logger should send its output to it's parent Logger.

BOOLEAN

true

false

read-write

no-services

Any

category

Specifies the category for the logger.

STRING

false

false

read-only

 

Any

async-handler

Defines a handler which writes to the sub-handlers in an asynchronous thread. Used for handlers which introduce a substantial amount of lag.

Attribute

Description

Type

Allow Null

Expression Allowed

Access Type

Restart Required

Allowed Values

name

The handler's name.

STRING

false

false

read-only

 

Any

level

The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.

STRING

true

false

read-write

no-services

"ALL","CONFIG","DEBUG","ERROR","FATAL","FINE","FINER","FINEST","INFO","OFF","TRACE","WARN","WARNING"

filter

Defines a simple filter type.

OBJECT

true

false

read-write

no-services

"all","any","accept","change-level","deny","level","level-range","match","not","replace"

formatter

Defines a formatter.

STRING

true

false

read-write

no-services

Any

queue-length

The queue length to use before flushing writing

INT

false

false

read-write

resource-services

Any

overflow-action

Specify what action to take when the overflowing. The valid options are 'block' and 'discard'

STRING

false

false

read-write

no-services

"BLOCK","DISCARD"

subhandlers

The Handlers associated with this asycn handler.

LIST

true

false

read-write

no-services

Any

console-handler

Defines a handler which writes to the console.

Attribute

Description

Type

Allow Null

Expression Allowed

Access Type

Restart Required

Allowed Values

name

The handler's name.

STRING

false

false

read-only

 

Any

encoding

The character encoding used by this Handler.

STRING

true

false

read-write

no-services

Any

level

The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.

STRING

true

false

read-write

no-services

"ALL","CONFIG","DEBUG","ERROR","FATAL","FINE","FINER","FINEST","INFO","OFF","TRACE","WARN","WARNING"

filter

Defines a simple filter type.

OBJECT

true

false

read-write

no-services

"all","any","accept","change-level","deny","level","level-range","match","not","replace"

formatter

Defines a formatter.

STRING

true

false

read-write

no-services

Any

autoflush

Automatically flush after each write.

BOOLEAN

true

false

read-write

no-services

Any

target

Defines the target of the console handler. The value can either be SYSTEM_OUT or SYSTEM_ERR.

STRING

true

false

read-write

no-services

"System.out","System.err"

file-handler

Defines a handler which writes to a file.

Attribute

Description

Type

Allow Null

Expression Allowed

Access Type

Restart Required

Allowed Values

name

The handler's name.

STRING

false

false

read-only

 

Any

encoding

The character encoding used by this Handler.

STRING

true

false

read-write

no-services

Any

level

The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.

STRING

true

false

read-write

no-services

"ALL","CONFIG","DEBUG","ERROR","FATAL","FINE","FINER","FINEST","INFO","OFF","TRACE","WARN","WARNING"

filter

Defines a simple filter type.

OBJECT

true

false

read-write

no-services

"all","any","accept","change-level","deny","level","level-range","match","not","replace"

formatter

Defines a formatter.

STRING

true

false

read-write

no-services

Any

autoflush

Automatically flush after each write.

BOOLEAN

true

false

read-write

no-services

Any

append

Specify whether to append to the target file.

BOOLEAN

true

false

read-write

resource-services

Any

file

The file description consisting of the path and optional relative to path.

OBJECT

true

false

read-write

no-services

Any

periodic-rotating-file-handler

Defines a handler which writes to a file, rotating the log after a time period derived from the given suffix string, which should be in a format understood by java.text.SimpleDateFormat.

Attribute

Description

Type

Allow Null

Expression Allowed

Access Type

Restart Required

Allowed Values

name

The handler's name.

STRING

false

false

read-only

 

Any

encoding

The character encoding used by this Handler.

STRING

true

false

read-write

no-services

Any

level

The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.

STRING

true

false

read-write

no-services

"ALL","CONFIG","DEBUG","ERROR","FATAL","FINE","FINER","FINEST","INFO","OFF","TRACE","WARN","WARNING"

filter

Defines a simple filter type.

OBJECT

true

false

read-write

no-services

"all","any","accept","change-level","deny","level","level-range","match","not","replace"

formatter

Defines a formatter.

STRING

true

false

read-write

no-services

Any

autoflush

Automatically flush after each write.

BOOLEAN

true

false

read-write

no-services

Any

append

Specify whether to append to the target file.

BOOLEAN

true

false

read-write

resource-services

Any

file

The file description consisting of the path and optional relative to path.

OBJECT

true

false

read-write

no-services

Any

suffix

Set the suffix string. The string is in a format which can be understood by java.text.SimpleDateFormat. The period of the rotation is automatically calculated based on the suffix.

STRING

false

false

read-write

no-services

Any

size-rotating-file-handler

Defines a handler which writes to a file, rotating the log after a the size of the file grows beyond a certain point and keeping a fixed number of backups.

Attribute

Description

Type

Allow Null

Expression Allowed

Access Type

Restart Required

Allowed Values

name

The handler's name.

STRING

false

false

read-only

 

Any

encoding

The character encoding used by this Handler.

STRING

true

false

read-write

no-services

Any

level

The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.

STRING

true

false

read-write

no-services

"ALL","CONFIG","DEBUG","ERROR","FATAL","FINE","FINER","FINEST","INFO","OFF","TRACE","WARN","WARNING"

filter

Defines a simple filter type.

OBJECT

true

false

read-write

no-services

"all","any","accept","change-level","deny","level","level-range","match","not","replace"

formatter

Defines a formatter.

STRING

true

false

read-write

no-services

Any

autoflush

Automatically flush after each write.

BOOLEAN

true

false

read-write

no-services

Any

append

Specify whether to append to the target file.

BOOLEAN

true

false

read-write

resource-services

Any

file

The file description consisting of the path and optional relative to path.

OBJECT

true

false

read-write

no-services

Any

rotate-size

The size at which to rotate the log file.

STRING

false

false

read-write

no-services

Any

max-backup-index

The maximum number of backups to keep.

INT

false

false

read-write

no-services

Any

custom-handler

Defines a custom logging handler. The custom handler must extend java.util.logging.Handler.

Attribute

Description

Type

Allow Null

Expression Allowed

Access Type

Restart Required

Allowed Values

name

The handler's name.

STRING

false

false

read-only

 

Any

encoding

The character encoding used by this Handler.

STRING

true

false

read-write

no-services

Any

level

The log level specifying which message levels will be logged by this. Message levels lower than this value will be discarded.

STRING

true

false

read-write

no-services

"ALL","CONFIG","DEBUG","ERROR","FATAL","FINE","FINER","FINEST","INFO","OFF","TRACE","WARN","WARNING"

filter

Defines a simple filter type.

OBJECT

true

false

read-write

no-services

"all","any","accept","change-level","deny","level","level-range","match","not","replace"

formatter

Defines a formatter.

STRING

true

false

read-write

no-services

Any

class

The logging handler class to be used.

STRING

false

false

read-only

 

Any

module

The module that the logging handler depends on.

STRING

false

false

read-only

 

Any

properties

Defines the properties used for the logging handler. All properties must be accessible via a setter method.

LIST

false

false

read-write

no-services

Any

What is the %s and %E in the pattern-formatter's pattern?

           <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n"/>

%s is the message

%E is the exception if one exists

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-13 13:22:04 UTC, last content change 2014-04-17 14:47:09 UTC.