Re: MySQL and Syslog

2010-05-15 Thread Dan Nelson
In the last episode (May 15), James Corteciano said:
 Hi All,
 
 Anyone had tried to push all MySQL logs to the centralized syslog server?
 Can you share with me how did you do it?
 
 I have centralized syslog (rsyslog-3.22.1-3.el5) server who resides
 separately and a remote MySQL server (mysql-server-5.0.77-4.el5_4.2) on
 other node. How to accomplish this to work smoothly that all logs of MySQL
 will be forwarded to the syslog?

Best solution is to upgrade to mysql 5.1 and pass --syslog to mysqld_safe when
starting mysql:

  
http://dev.mysql.com/doc/refman/5.1/en/mysqld-safe.html#option_mysqld_safe_syslog

Next best solution:

  tail -F -n 0 /path/to/mysql.err | logger -p daemon.notice -t mysql 

Run that before starting mysql, and any lines written to the log file will
get redirected to syslog.

-- 
Dan Nelson
dnel...@allantgroup.com

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/mysql?unsub=arch...@jab.org



Re: MySQL to syslog

2003-08-16 Thread Stephen Touset
Correct me if I'm wrong, but won't this cause it to no longer be a 
real-time solution? The machine I'm running MySQL on is fairly 
vulnerable to attack (which, for the time being, cannot be 
changed...although I have secured it as much as is possible), which is 
why I'm logging everything remotely. If the solution is not real-time, 
theoretically someone can gain unauthorized access and remove traces of 
their entry before the logs are batched up and sent. This is what I want 
to prevent.

Stephen Touset

Harald Fuchs wrote:

In article [EMAIL PROTECTED],
Stephen Touset [EMAIL PROTECTED] writes:
 

However, I have a different need. I'm setting up several machines on a
network, and wish for them all to send logs through stunneled syslog
connections to a central logging server, where I can run logcheck et al
to generate reports of system abuse and ensure that all services are
running smoothly. However, with MySQL logging to it's own file, this
presents a problem to me. Some solutions I can see are simply rsync'ing
the logs over daily or mounting the directory over NFS and copying the
logs. However, both of these require me to set up new services, and/or
change already-existing firewall rules, and write new scripts to do the
fetching/retrieval, all of which takes time and effort--not to mention,
needlessly complicates the system.
   

How about making the error log a named pipe and reading from it with logger?

 



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


RE: MySQL to syslog

2003-08-15 Thread Sagar, Sanjeev
I am not sure that MySQL can directly log to syslog but Unix provide this

logger - make entries in the system log

logger [-t tag] [-p pri] [-i] [-f file] [message...]

So you use MysQL to put messages in a file and then use logger to send it to
syslogs. This is how we do it too.

Regards,

-Original Message-
From: Stephen Touset [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2003 10:28 AM
To: [EMAIL PROTECTED]
Subject: MySQL to syslog


Is there now a way within MySQL to log to syslog? I was reading an archived
email conversation between Sinisa Milivojevic and Vincent Stoessel in which
they seemed to indicate that there was no need to log to syslog. As Vincent
only had a request for timestamps in the error log, Sinisa simply satisfied
that demand and moved on.
 
However, I have a different need. I'm setting up several machines on a
network, and wish for them all to send logs through stunneled syslog
connections to a central logging server, where I can run logcheck et al to
generate reports of system abuse and ensure that all services are running
smoothly. However, with MySQL logging to it's own file, this presents a
problem to me. Some solutions I can see are simply rsync'ing the logs over
daily or mounting the directory over NFS and copying the logs. However, both
of these require me to set up new services, and/or change already-existing
firewall rules, and write new scripts to do the fetching/retrieval, all of
which takes time and effort--not to mention, needlessly complicates the
system.
 
Have other people expressed a need to do this? I can't imagine that I'm the
first person to run into this limitation, so all I can reason is that either
a) the functionality's in there, and my Google skills have failed me, or b)
there are valid reasons for the lack of inclusion, and there's a simple
workaround. If either is the case, please, let me know!
 
Thanks in advance.

-- 
Stephen Touset [EMAIL PROTECTED]

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: MySQL and Syslog.

2002-05-28 Thread Jeremy Zawodny

On Tue, May 28, 2002 at 01:39:31PM +0200, Dries Robberechts wrote:
 Hi people,
 
 Is there a way to have the mysqld log to syslog, instead of the
 errorlog flatfile?

Nope.

 I tried piping it to a stdin-to-syslog script, but that wouldn't
 work either.

There's a chance that MySQL is logging to STDERR not STDOUT.

Jeremy
-- 
Jeremy D. Zawodny, [EMAIL PROTECTED]
Technical Yahoo - Yahoo Finance
Desk: (408) 349-7878   Fax: (408) 349-5454   Cell: (408) 685-5936

MySQL 3.23.51: up 0 days, processed 5,449,896 queries (226/sec. avg)

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php