My FNZ Studio Version

System Maintenance

Latest Update: 16.11.2023 |
Documentation
2022.2
2022.1
11
10
9
8
7

1 Introduction

Appway uses Apache log4j as the logging framework. This article describes how log4j is initialized and configured by Appway, and how you can modify this configuration.

For more information on log4j, see the Apache site.

2 Configuration

The configuration property nm.log4j.initialize determines whether Appway initializes the log4j framework on start-up. The default value of this property is true.

To disable the log4j initialization, set this property to false in the server configuration. This can be necessary if some other component of your execution environment already has initialized log4j, for example your Java application server.

If you set this property to false, Appway will not create the log files error.log and debug.log automatically.

2.1 Default Configuration

Appway has a built-in log4j configuration file. The file is located on the class path under com/nm/conf/log4j.properties.

The configuration presented below is just an example. To download the correct logging configuration for your Appway release from the Studio, go to System Maintenance > Logging > Settings. Right-click on the desired configuration and select Download.
log4j.threshold = ALL

# report errors to stdout
log4j.rootLogger = ERROR, stdlog

# default logger for Appway
log4j.logger.com.nm = WARN, stdlog, errlog, dbglog
log4j.additivity.com.nm = false

# console appender for stdout
log4j.appender.stdlog = org.apache.log4j.ConsoleAppender
log4j.appender.stdlog.target = System.out
log4j.appender.stdlog.immediateFlush = true
log4j.appender.stdlog.layout = org.apache.log4j.PatternLayout
log4j.appender.stdlog.layout.ConversionPattern = %d %-5p %c - %m%n

# default Appway debug.log
log4j.appender.dbglog = org.apache.log4j.RollingFileAppender
log4j.appender.dbglog.file = ${nm.data.home}/logs/debug.log
log4j.appender.dbglog.append = true
log4j.appender.dbglog.immediateFlush = true
log4j.appender.dbglog.maxFileSize = 4MB
log4j.appender.dbglog.maxBackupIndex = 4
log4j.appender.dbglog.layout = org.apache.log4j.PatternLayout
log4j.appender.dbglog.layout.ConversionPattern = %d %-5p %c - %m%n

# default Appway error.log
log4j.appender.errlog = org.apache.log4j.DailyRollingFileAppender
log4j.appender.errlog.file = ${nm.data.home}/logs/error.log
log4j.appender.errlog.append = true
log4j.appender.errlog.immediateFlush = true
log4j.appender.errlog.datePattern = .yyyy-MM-dd
log4j.appender.errlog.threshold = INFO
log4j.appender.errlog.layout = org.apache.log4j.PatternLayout
log4j.appender.errlog.layout.ConversionPattern = %d %-5p %c - %m%n

# logger used to broadcast startup and shutdown messages
log4j.logger.all = INFO, stdlog, errlog, dbglog
log4j.additivity.all = false

# logger for Appway's SystemServicesManager
log4j.logger.com.nm.utils.SystemServicesManager = INFO

This example configuration contains the following aspects:

  • Error messages will be sent to StdOut.
  • Messages from Appway (package com.nm) will be sent to StdOut and the two log files error.log and debug.log. By default, only errors and warnings are reported (level = WARN).
  • The log file error.log is saved in the directory <DataHome>/logs and is rotated once a day. The logs from the previous days have a time stamp appended to their name (example: "error.log.2011-07-20"). This file never contains debug messages (threshold = INFO).
  • The log file debug.log is saved in the directory <DataHome>/logs and is rotated whenever its size reaches 4MB. If this happens, the file is renamed to debug.log.1. If this file already exists, it is first renamed to debug.log.2, and so on. There are 5 debug.log files at maximum, up to debug.log.4.
  • A special logger named all is used to broadcast start-up and shutdown messages to StdOut, error.log and debug.log.

2.2 Configuration Files

On start-up, Appway will check if there is a file log4j.properties in the directory <DataHome>/conf. If the file exists, it will be used to initialize log4j. This basically REPLACES the default configuration. You can use this method if you must do fundamental changes on how log4j is initialized.

If you only need to add or change some configuration properties, create a file called log4j-additional.properties. If this file exists on start-up, Appway uses its content to OVERRIDE the properties loaded from the default configuration or from the log4j.properties file above. You can use this method if you would like to make a single logger level persistent:

log4j.logger.com.nm.services.WorkflowEngineServiceImpl = DEBUG

Or you can attach additional log files to Appway components:

log4j.logger.com.nm.filter.DebugFilter = DEBUG, reqlog
log4j.additivity.com.nm.filter.DebugFilter = false

log4j.appender.reqlog = org.apache.log4j.FileAppender
log4j.appender.reqlog.file = /var/log/requests.log
log4j.appender.reqlog.layout = org.apache.log4j.PatternLayout
log4j.appender.reqlog.layout.ConversionPattern = %d %-5p %c - %m%n

If you would like to define a file path to a log file inside Appway's data home directory, you can use the place holder ${nm.data.home}:

log4j.appender.myapp.file = ${nm.data.home}/logs/myapp.log
© 2026 Appway AG. All Rights Reserved