Installation

Externalizing log4j.properties

Overview

This document provides instructions for externalizing log4j.properties in the OvalEdge application running on Tomcat. 

log4j.properties is a configuration file used in Java applications to configure logging behavior using the Apache Log4j library. Log4j is a popular logging library in the Java ecosystem, widely used for logging messages from applications to various destinations such as console, files, databases, etc.


The log4j.properties file allows developers to specify logging settings such as:

Logging Levels: Configuring which levels of log messages should be recorded (e.g., DEBUG, INFO, WARN, ERROR, FATAL).

Appenders: Defining where log messages should be outputted (e.g., console, file, database).

Layouts: Specifying the format of log messages (e.g., timestamp, log level, message).

Loggers: Configuring specific loggers for different parts of the application, allowing fine-grained control over logging behavior.


By following these steps, users can configure log4j.properties:

1. Log into OvalEdge Application VM: Access the OvalEdge application virtual machine (VM) using appropriate credentials.

2. Copy Log4j Properties File: Navigate to the ext-prop folder within the VM. Use the following command to copy the log4j.properties file from its original location to the ext-prop folder:

Command Prompt

/home/ovaledge/ovaledge/tomcat/webapps/ROOT/WEB-INF/classes/log4j.properties /home/ovaledge/ext-prop

3. Specify Log File Path: Provide the full path of the folder where the logs should be created. This path will be used in the Log4j configuration.

4. Edit setenv.sh File: Navigate to the Tomcat bin directory. Open the setenv.sh file using the following command:

Command Prompt

$ vi setenv.sh 

5. Add the following configuration to the setenv.sh file, replacing <ext-prop path> with the path to the ext-prop folder where the log4j.properties file is located:

6. Restart Tomcat: Restart the Tomcat server to apply the Log4j configuration changes.

By following these steps, users can successfully externalize Log4j properties for the OvalEdge application on Tomcat, allowing for efficient management of logging settings.