Configuring system logging

Logging by EAServer classes and Java clients is written to a log file whose name is determined by the system property djc.logFile. If you do not explicitly set this property, the default file name is default.log, which is created in the server’s logs subdirectory.

Table 3-4 defines logging properties that you can set either on the command line, or in either local-setenv.bat (Windows) or local-setenv.sh (UNIX).

You can also enable the logging and tracing properties defined on the server’s Log/Trace tab, by prepending “djc.” to the configuration property name, and setting the value to true. For example, to enable EJB tracing, set djc.ejbTrace=true; to echo logging to the console, set djc.echoLog=true.

Table 3-4: Logging properties

Property

Description

djc.logFile

The name and path of the log file.

djc.logFileReUse

Specify whether to overwrite the contents of the log file when it reaches its maximum size; true or false.

djc.logFileMaxSize

The maximum file size. Specify one of:

  • -1 to indicate no limit

  • Nm, where N is the number of megabytes

  • Nk, where N is the number of kilobytes

djc.logFileRotation

Specify whether to create a new log file when the existing log file reaches its maximum size; true or false. If set to true, log files are named sequentially; for example, mylog.log.001, mylog.log.002, and so on.

djc.logFileArchive

Specify whether to archive the log file; true or false.

djc.logFileArchiveName

To archive the log file, specify the name of the archive file. The value of djc.logFileArchive must be true.

djc.logFileArchiveCompress

Specify whether to compress log file archives; true or false. If set to true, the log file archive is compressed to a file named ${djc.logFileArchiveName}.zip

StepsSetting logging options on the command line

  1. To set logging options on the command line, use:

    -Ddjc.logFile=/myserver/myserver.log -Ddjc.logFileMaxSize=5m 
    -Ddjc.logFileRotation=true
    

    When you run a Java client, you can specify logging options on the command line; for example:

    %JAVA_HOME%\bin\java -Ddjc.rmiTrace=true 
    -Ddjc.logFile=%DJC_HOME%\logs\rmiClientTrace.log myClient
    

StepsSetting logging options in local-setenv.bat or local-setenv.sh

  1. To specify log options in local-setenv.bat or local-setenv.sh, so they are set every time you start the server, use:

    set DJC_JVM_ARGS=%DJC_JVM_ARGS% -Ddjc.logFile=/myserver/myserver.log 
    -Ddjc.logFileMaxSize=5m -Ddjc.logFileRotation=true
    

    See “Setting environment variables”.