Category: MyQuests

rss

Remote logging with rsyslog, php and agavi

When I tried to get rsyslog running with php I didn't face much problems. Anyways I want to share some things I noticed while getting it to work.

First of all ubuntu uses rsyslog already. Just a simple

1
# apt-get install rsyslog-mysql

and all syslog messages went directly into the database "syslog". Configure /etc/rsyslog.d/mysql.conf to insert this information into a remote machine.

Now let's get to php. You have the option to set:

1
error_log=syslog

This however does log all messages with

1
php: whatever the issue or error is

If you want to replace "php" with a custom message, you have to call

1
openlog('myapp', LOG_PID | LOG_ODELAY, LOG_USER);

before any error happens. Because LOG_ODELAY is given, it won't connect to syslog unless any error happens, so one should be save to put this call at the top of your dispatcher file.

The final log message will look like that (254 is the process id):

1
Sep 26 13:39:44 root-server myapp[254]: the issue or error

Finally I wanted to log all messages created by agavi's logging system. Since I didn't found an existing AgaviSyslogLoggerAppender, I wrote one and put it up on a github-gist.

Have fun logging!

In MyQuests, php, Agavi & Ubuntu By DracoBlue @ 13:55 26.09.2011

Added option to hide quest targets

A friend of mine asked if I could add a new feature to MyQuests. Since it has svn-repository and is written in Lua, it wasn't that difficult.

I send the .patch to the maintainer, he added it.

In open source & MyQuests By DracoBlue @ 19:00 14.08.2006

Fixed admin issue in MyQuests

Since last update it wasn't possible to use the admin menu in MyQuests correctly.

I send the .patch to the maintainer. He updated the svn version already.

In open source & MyQuests By DracoBlue @ 16:00 10.08.2006