Glassfish Logs

Monitoring Glassfish logs with the help of OpManager Nexus AppLogs is smooth and efficient, as all the associated log data is retrieved and presented in one collective view. Glassfish log data is presented by splitting them into appropriate fields like date & time, product version, module, log level, key values, time mills, level value, source file name and message. Learn more about log management with OpManager Nexus. 

Getting started

  1. Log in to your OpManager Nexus account.
  2. Download and install the OpManager Nexus 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. By default, Glassfish logs are sourced from the below mentioned folder path for the respective Operating System. If you have logs in 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/glassfish/domains/*/logs/server.log*
Windows icon
:
C:\glassfish*\domains\*\logs\server.log*
 
 
C:\Program Files\glassfish*\domains\*\logs\server.log*

Log pattern

$DateTime:date$] [$ProductVersion$] [$LogLevel$] [$Module$] [$SourceFileName$] [$KeyValues$] [timeMillis: $TimeMills:number$] [levelValue: $LevelValue:number$] [[$Message$]]

This is the default pattern defined by OpManager Nexus for parsing Glassfish logs based on the sample mentioned below.

Sample log

[2017-01-09T13:30:13.278+0530] [glassfish 4.1] [INFO] [NCLS-JMX-00002] [javax.enterprise.system.jmx] [tid: _ThreadID=176 _ThreadName=Thread-37] [timeMillis: 1483948813278] [levelValue: 800] [[JMXStartupService: Stopped JMXConnectorServer: null]]

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

Field name Field value
Date Time 2017-01-09T13:30:13.278+0530
Product Version glassfish 4.1
Log Level INFO
Module NCLS-JMX-00002
Source File Name javax.enterprise.system.jmx]
Key Values tid: _ThreadID=176 _ThreadName=Thread-37]
Time Mills timeMillis: 1483948813278
Level Value levelValue: 800
Message JMXStartupService: Stopped JMXConnectorServer: null
Shortlink has been copied!