MySQL General Logs

Site24x7 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 Site24x7.

Getting started 

  1. Log in to your Site24x7 account.
  2. Download and install the Site24x7 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 Site24x7 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 Site24x7.

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

Related log types

Was this document helpful?
Thanks for taking the time to share your feedback. We’ll use your feedback to improve our online help resources.