Tag: Syslog

Remote Syslog Server

These notes are intended for Ubuntu 18.04!

Install and Configure Rsyslog Server

$ dpkg -l | grep rsyslogd
$ apt-get update && apt-get install rsyslog

$ systemctl start rsyslog
$ systemctl enable rsyslog
$ systemctl status rsyslog

Check rsyslog version (v7 vs. v8!):

$ rsyslogd -v

General configuration

#
# /etc/rsyslog.conf
#

# provides UDP syslog reception
module(load="imudp")
input(type="imudp" port="514")

and/or

# provides TCP syslog reception …


MariaDB Log Rotation

Modern Linux Systems have a mechanism called logrotate to rotate different log files.

The general configuration file is located under /etc/logrotate.conf and specific changes are under /etc/logrotate.d/

By default the logrotate job is started once a day by a O/S cron.daily job: /etc/cron.daily/logrotate

Because the default log rotation configuration does not exactly what I want I have adapted it a bit:

First I need a database user for log rotation:

SQL> CREATE USER 'logrotate'@'localhost' IDENTIFIED BY …


Logging users to the MySQL error log

Problem

A customer recently showed up with the following problem:

With your guidelines (MySQL reporting to syslog) I am now able to send the MySQL error log to the syslog and in particular to an external log server.
But I cannot see which user connects to the database in the error log.

How can I achieve this?

Idea

During night when I slept my brain worked independently on this problem and in the morning he had prepared a possible solution for it.

What came out is the following:

  • We create an UDF which …


MySQL reporting to syslog

IMPORTANT: These information are outdated!

There are 2 different possible situations you can face when you have to deal with MySQL and syslog:

In this blog article we look at the second situation: How can you make MySQL reporting to syslog.

Since the version 5.1.20 MySQL is capable to log to syslog: The Error Log, …




Subscribe to RSS - Syslog