[MDEV-10197] Document what integer in error log means Created: 2016-06-08  Updated: 2016-06-15  Resolved: 2016-06-15

Status: Closed
Project: MariaDB Server
Component/s: Documentation
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Geoff Montee (Inactive) Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: documentation, logging


 Description   

The error log in MariaDB 10.1 has entries like the following:

2016-05-11 14:50:00 140452469635200 [Note] /usr/sbin/mysqld: ready for connections.

What does "140452469635200" mean in this context? It is not documented here:

https://mariadb.com/kb/en/mariadb/error-log/

Is this the process ID, as added in this upstream patch?

https://bugs.mysql.com/bug.php?id=56240

Or is this some thread ID, as referenced in the MySQL 5.7 documentation?

As of MySQL 5.7.2, the ID included in error log messages is that of the thread within mysqld responsible for writing the message. This indicates which part of the server produced the message, and is consistent with general query log and slow query log messages, which include the connection thread ID. Before MySQL 5.7.2, the ID in error log messages is that of the mysqld process ID.

http://dev.mysql.com/doc/refman/5.7/en/error-log.html



 Comments   
Comment by Valerii Kravchuk [ 2016-06-09 ]

In current 10.1 code from GitHub I see the following call eventually (line 8399 in sql/log.cc):

   8399   fprintf(stderr, "%d-%02d-%02d %2d:%02d:%02d %lu [%s] %.*s%.*s\n",
   8400           start->tm_year + 1900,
   8401           start->tm_mon+1,
   8402           start->tm_mday,
   8403           start->tm_hour,
   8404           start->tm_min,
   8405           start->tm_sec,
   8406           (unsigned long) pthread_self(),
   8407           (level == ERROR_LEVEL ? "ERROR" : level == WARNING_LEVEL ?
   8408            "Warning" : "Note"),
   8409           tag_length, tag,
   8410           (int) length, buffer);
   8411
   8412   fflush(stderr);

So, this is thread ID as pthread_self() shows, see http://linux.die.net/man/3/pthread_self.

Comment by Ian Gilfillan [ 2016-06-15 ]

A description of the error log format has been added to the documentation

Generated at Thu Feb 08 07:40:23 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.