MySQL General Logs

OpManager Nexus AppLogs is a cloud-based log monitoring service that facilitates you to manage your logs across all your servers. MySQL log information is dissecting into parts such as date & time, thread ID, log level, and message, and then managed. With default support for MySQL logs, you can view, analyze, and also search log data with our intuitive user interface. 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 (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, mySQL general Logs are 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/myqld*.log
 
 
/var/log/mysql/mysql.log
 
 
/var/log/mysql/*error*.log

Log pattern

$DateTime:date$ $ThreadId$ [$LogLevel$] $Message$

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

Sample log

2017-06-27T05:57:19.695570Z 3 [Note] Access denied for user 'root'@'localhost' (using password: NO)

The above sample log can be separated into 4 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-06-27T05:57:19.695570Z
Thread ID 3
Log Level Access denied for user 'root'@'localhost'
Message using password: NO
Shortlink has been copied!