It explains the details of the log file and how to change the log file output destination.

system.log

All operations to the web application are recorded.From the initialization and stop information of each service related to starting and stopping the application, it is recorded who logged on and what kind of operation was done.Recording about jobs is also done.

This file is output depending on the date and time when the log occurred.

catalina.YYYY-MM-DD.log

The Tomcat log is output.This is the same as what is output to the console.Information on Tomcat is included when the service is started or stopped.

Like system.log, it is output according to the date and time when the log occurred.

When Hibernate's SQL output is enabled

When Hibernate's SQL output is enabled, Depending on the OS running the web application, it becomes as follows.

For Windows OS

If you launch a web application from Wagby Builder or startup.bat on Windows, it will be output only to the console and will not be output to this log file.

For Linux OS

It is output to both the console and this log file.

localhost.YYYY-MM-DD.log

A log of the web application executed within Tomcat is output. Logs of Spring and Quartz (for executing jobs) are output when the service starts and stops (it is middleware used internally by Wagby).

Like system.log, it is output according to the date and time when the log occurred.

system.log

The output destination of system.log is specified in the file log4j.properties. This file is provided in the wagbyapp \ webapps \ $ (APPNAME) \ WEB-INF \ classes folder.

By default, the setting of the output destination is as follows.

log4j.appender.F.File=${catalina.home}\logs\system.log

$ {Catalina.home} refers to the origin directory of Tomcat.It is the same as $ (DEVHOME) \ wagbyapp. You can change the output destination by modifying this part.

If you customize this file, please save it to the $ (DEVHOME) \ customize \ resources folder.The customization file will be reflected in the next build.

catalina.YYYY-MM-DD.log
localhost.YYYY-MM-DD.log

In these files, the output destination is specified in the setting file named logging.properties. This file is provided in the wagbyapp \ conf folder.

By default, the setting of the output destination is as follows.

1catalina.org.apache.juli.AsyncFileHandler.directory = $ {catalina.base} / logs 2localhost.org.apache.juli.AsyncFileHandler.directory = $ {catalina.base} / logs

$ {Catalina.base} refers to the origin directory of Tomcat.It is the same as $ (DEVHOME) \ wagbyapp.

If you customize this file, please save it to the $ (DEVHOME) \ customize \ tomcat_opt \ conf folder.

The log file keeps increasing while the web application is running.The application does not automatically delete it.

Wagby offers "Delete file"Or"File compressionBy using the job, you can operate to suppress the enlargement of the log file.However, in this case as well, it is recommended to save past log files somewhere.Logs can be used as an audit trail in emergency.

Log of database operation script

For wagbyapp which is a built application, the following script file under the bin folder also outputs logs at the time of execution.

  • check_db.bat (check_db.sh)
  • drop_db.bat (drop_db.sh)
  • export_db.bat (export_db.sh)
  • import_db.bat (import_db.sh)
  • init_db.bat (init_db.sh)
If you are using Linux environment, please use the file with .sh extension.

check_db

Run wagbyapp \ bin as the current directory.The execution result is output as the check_db.txt file in the same directory.This output position is specified in the check_db.bat file.

The log file at the time of execution is output to wagbyapp \ logs \ initdb.log.However, if there is no more log than warning, it will not be output.

The log file name is given date information (corresponding to system.log) corresponding to the date of output.For example, it will be a file name such as initdb.log.20170401.

The detailed setting of this log file is specified in log4j.properties included in InitLoader.jar.(How to change will be described later.)

drop_db,export_db,import_db,init_db

Run wagbyapp \ bin as the current directory.The log file at the time of execution is output to wagbyapp \ logs \ initdb.log.However, if there is no more log than warning, it will not be output.

The log file name is given date information (corresponding to system.log) corresponding to the date of output.For example, it will be a file name such as initdb.log.20170401.

The detailed setting of this log file is specified in log4j.properties included in InitLoader.jar.(How to change will be described later.)

Change the output destination of initdb.log

Initdb.log has the following properties.

  • The log level is "WARN".
  • Logs are output to both the console and the file.

To change this, please set as follows.

  1. Open the script file whose setting you want to change with a text editor.(Here we take export_db.bat as an example.)
  2. As shown below, use the -l option to specify the file for which log output information is specified.
    "%JAVA_HOME%\bin\java" -Xmx512m -XX:MaxPermSize=192m -Dcatalina.home=".." -Djava.io.tmpdir="${catalina.home}\temp" -jar InitLoader.jar export -all -check_exists_table true -c ..\webapps\wagby\WEB-INF\export\conf\initdb.xml -l exportlog.properties  -d "%EXPDIR%"
    
  3. Prepare the "exportlog.properties" file specified above.In this example, save it in the same folder as the current folder, ie export_db.bat.When preparing a folder separately, it is a good practice to specify the relative path from wagbyapp \ bin which is the folder where export_db.bat exists.An example of exportlog.properties is shown below.
    Log4j.rootCategory = WARN, C, F log4j.appender.C = org.apache.log4j.ConsoleAppender log4j.appender.C.layout = jp.jasminesoft.util.log4j.ThrowablePatternLayout log4j.appender.C.layout.ConversionPattern = D {yyyy-MM-dd HH: mm: ss} [% p% c]% m% n log4j.appender.F = org.apache.log4j.DailyRollingFileAppender log4j.appender.F.DatePattern = '.' Yyyy-MM -dd
    log4j.appender.F.File=../logs/exportdb.log
    Log4j.appender.F.layout = jp.jasminesoft.util.log4j.ThrowablePatternLayout log4j.appender.F.layout.ConversionPattern =% d {yyyy - MM - dd HH: mm: ss} [% p% c]% m% N
    
    Here, we change the log output destination to "../logs/exportdb.log".