Help Docs

Log4J Logs

Log4j is a widely used logging framework in java application. Site24x7 agent automatically detects Log4j logs in your machine and identifies the log fields such as date & time, log level, source file name, line, and message. With default support for Log4J logs one can search, view, collect and analyze the data with the help of our intuitive web client. Site24x7 AppLogs is a one of a kind cloud-based log management service that helps you manage logs with ease. Learn more about log management with Site24x7.

Getting started 

  1. Log in to your Site24x7 account.
  2. Download and install the Site24x7 Server Monitoring agent (Windows | Linux). 
  3. Go to Admin > AppLogs > Log Profile and Add Log Profile.

Logs file path

Each application writes logs in different folders and files. Log4J logs will be sourced from the below mentioned folder path for the respective Operating System. If you have logs in a different folder, you can mention it under the File Path to source them from that particular folder while creating a log profile.

Linux icon
:
/var/log/java/*.log*
Windows icon
:
C:\\*java*\\logs\\*.log

 

Log file path given here is for reference ONLY. By default Site24x7 runs a script to find the specific file path.

Log pattern

DateTime:date$ $LogLevel$ $SourceFileName$ $Line:number$ - $Message$

This is the default pattern defined by Site24x7 for parsing Log4J Logs based on the sample log mentioned below.

Sample log

2017-07-02 20:52:39,342 DEBUG className 200 - This is debug message

The above sample log can be separated into 5 fields, each of which will take its respective value from here and will then be uploaded to Site24x7.

 Field name  Field value
Date Time  2017-07-02 20:52:39, 342
Log Level DEBUG
Source File Name   className
Line 200
Message This is debug message

Log4J logs dashboard

AppLogs creates an exclusive dashboard for every Log Type, and shows a few widgets by default. Here's a list of the widgets available in the Log4J logs dashboard:

  • Exceptions
  • Most Log Generator
In addition to the default widgets, your saved searches will also be added to the dashboard automatically.

Related log types

Was this document helpful?

Shortlink has been copied!