Re: asl log level "info"
Re: asl log level "info"
- Subject: Re: asl log level "info"
- From: "Jordan K. Hubbard" <email@hidden>
- Date: Wed, 7 Mar 2007 11:26:53 -0800
On Mar 7, 2007, at 1:01 AM, Gabriel Zachmann wrote: i really would like to log messages from my app with log level ASL_LEVEL_INFO through the asl API. Alternatively, i could live with a separate log file, but i wasn't able to achieve that either.
Does anybody know how to do that without editing syslog.conf, or any other "sudo" commands?
I am able to log messages at level "notice". I have searched the lists quite a bit, to no avail. Below you can find some code that i tried. Please note that that code is just a snapshot of many variations i have experimented with.
There are two filters involved (and yes, I know this is a little arcane - the man page for syslog(1) can probably be improved). One is the client-side filter, which is set with asl_set_filter() as you've already figured out. The other is the syslogd filter, which also does not log messages at ASL_LEVEL_INFO by default. OK, I lied, there are actually THREE filters (there's also a "master" client side filter) but let's ignore the third for the purposes of this email since it's off by default anyway.
By default, syslogd is still filtering these messages so you're not going to see them without changing syslogd's filter mask. Try this:
sudo syslog -c syslogd -6
I know you wanted to avoid using "sudo" but you have to do it at least once in this scenario since only root can change the default syslogd mask (it can lead to your asl.db filling up pretty quickly if you have some particularly chatty clients running). Another option if you want this always on is to edit /System/Library/LaunchDaemons/com.apple.syslogd.plist and add "-c 6" to the launch arguments.
- Jordan
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden