← Back to blog
Security

Send logs to localsyslog (Apache,Mysql,Glassfish)

30 May 2013

Adding you logfiles to an syslog server is an easy way to get all logs collected in one place.

I Use to set all my service (apache,mysqlmmm) to log there logs to the local syslog server.
Then I config the local syslog to send al its log to an central logserver.
This way I get all my logs collected and displayd at one place.
Apache
In the file httpd.con fins the line ErrorLogs and replace the line with
ErrorLog syslog:local1

Mysql
In the file my.cnf fins the section [mysqld_safe] And add at top

[mysqld_safe]
syslog
Glassfish
To make the glassfish server send its log to you localsyslog find the command asadmin locaed in you glassfish folder.
and run the command.
./asadmin set-log-attributes com.sun.enterprise.server.logging.SyslogHandler.useSystemLogging=true