LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   elp understanding syslog (https://www.linuxquestions.org/questions/linux-newbie-8/elp-understanding-syslog-672380/)

blancs 09-25-2008 04:41 PM

help understanding syslog
 
I run a game server under a regular user on my box, it also logs everything to the syslog file (which i don't care for becuase i think it is messy and a whole lot of output) insted id like it to go to it's own log file, something like /var/log/game.log. I have been reading over the syslog.conf file and undertand you can separate logs using faculties those being:

auth - authentication (login) messages
cron - messages from the memory-resident scheduler
daemon - messages from resident daemons
kern - kernel messages
lpr - printer messages (used by JetDirect cards)
mail - messages from Sendmail
user - messages from user-initiated processes/apps
local0-local7 - user-defined (see below)
syslog - messages from the syslog process itself

can this be done. cause i feel like it couldnt just log the game output to its own file, but rather all user logs via:

user.* -/var/log/user.log

kenneho 09-26-2008 02:03 AM

It seems like the application itself must define which faculties to use, so if the gameing app uses USER then you must redirect all user logs to a file (as you suggested).

But I'm may be wrong, so get someone else's opinion also. :)

Mr. C. 09-26-2008 02:23 AM

Run strace on the application, and watch for calls to openlog and syslog. The third argument to openlog() will be the FACILITY and the first argument to syslog() will be the PRIORITY. These determine how syslog handles the log messages. Typically, general applications use the LOCAL0 - LOCAL7 FACILITYs.

strace gameserver

There will be a lot of output, so you can redirect or pipe the output if you want.

blancs 09-26-2008 10:15 AM

great thank you.


All times are GMT -5. The time now is 08:31 AM.