This article describes how to configure basic logging using a .props file regardless of which server application the logging is for. 

Note, however, that there is one exception. The logging for the TcpSubServer process in the split server architecture is configured using a different file (see How to Configure Logging for the TcPSubServer).


Prerequisites

  • A server installation directory containing all required files to run the server.
  • A .props file located in the same directory as the server application file.


Systemite can provide an example .prop file or simply copy the following content (provided with typical values) into a text editor. 


.prop file

# Set internal debugging
# log4d.debug=TRUE

log4d.rootCategory=INFO,Fil1
#log4d.rootCategory=DEBUG,Fil1

# Global disable level
# log4d.disable=INFO

# Override global disable level
# log4d.disableOverride=TRUE

# Set category factory
# log4d.categoryFactory=TLogDefaultCategoryFactory

# Set root priority
# log4d.rootCategory=WARN,ODS

# Establish category hierarchy
#log4d.category.myapp=INHERITED,Mem1
#log4d.category.myapp.more=DEBUG,Mem2
#log4d.category.myapp.other=INFO,Mem3,#Email
#log4d.category.alt=ERROR,Mem4,Fil1

# Myapp.other category doesn't log to its parents
#log4d.additive.myapp.other=FALSE

# Create root appender
#log4d.appender.ODS=TLogODSAppender
#log4d.appender.ODS.layout=TLogSimpleLayout

# Create a file appender
log4d.appender.Fil1=TFastLogFileAppender
log4d.appender.Fil1.append=TRUE
log4d.appender.Fil1.fileName=C:\swServerMonitorService.log
log4d.appender.Fil1.errorHandler=TLogOnlyOnceErrorHandler
log4d.appender.Fil1.layout=TLogPatternLayout
log4d.appender.Fil1.layout.pattern=%d [%t] %-5p %-6c %x - %m%n
log4d.appender.Fil1.layout.dateFormat=yyyy-mm-dd hh:mm:ss,zzz



Configuring the Logging

  1. Save the .prop file based on which server it is going to log.

    Application
    Name of .props File
    swServer or swDBServer (the main server)
    swServer.props
    swServerMonitorService
    swServerMonitorService.props
    swSlaveServer
    swSlaveServer.props
    swExplorer*
    swExplorer.props
    swNotificationServerswNotificationServer.props

    * Note that normally no logging is needed for the swExplorer since error messages display for users. Therefore, this props file can safely be omitted from the configuration.


  2. Open the .props file in a text editor. 
  3. Select which type of logging - INFO or DEBUG - to set for Log4d.rootCategory= and make one of them active.
    • The INFO level designates informational messages that highlight the progress of the application at coarse-grained level. (default)
    • The DEBUG Level designates fine-grained informational events that are most useful to debug an application.

Note: When DEBUG level is used, be aware that the size of the file can become quite large.

  1. Define the file path and name of the log file on the log4d.appender.Fil1.fileName= line.
  2. Set whether or not the log file should be cleared (=false) after restart of the server application or if logging should append on the log4d.appender.Fil1.append= line. The default of append is recommended.
  3. Save your changes. 


Example of INFO-level logging for swSlaveServer


Starting the Logging

Logging will start once you start and/or restart the server application.


Note: If a server application GUI is open while you complete the configuration, it must be first closed and then reopened prior to the start/restart for the logging to begin successfully.