Author |
Message
|
zpat |
Posted: Fri Dec 16, 2011 5:23 am Post subject: WMB logging in Unix (use of user.error) |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
WMB 7003, AIX
WMB help says that it uses the USER.ERR, USER.INFO, USER.DEBUG levels of system logging. USER is the "facility" name.
According to the /etc/syslog.conf file - these end up somewhere like /var/adm/messages or /var/mqsi/errors
Can someone explain if this "USER" facility is unique to WMB or used by other Unix applications? I think the latter.
If there a way to get WMB to use configurable/unique facility names (e.g. WMB7.ERR etc) so we can control the log files used more granularly?
How can I direct particular brokers or execution groups to use unique logging filenames, so I can separate out the log files?
I have a particularly "dirty" WMB application coming along and I would like to give it separate log files. |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Dec 16, 2011 5:52 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
I think I asked this before (regarding Linux) and you are going to be out of luck.
Short of rewriting the SYSLOG Daemon
that is...
As it is AIX you might be fortunate in the IBM in their infinite wisdom could have foreen this type of request.
As a longtime Unix/Linux user/dev/admin etc I feel that this is both a weakness and a strength. It woulbe nice to have the ability to put the different messages in different logs.
On the flip side, having this information spread about all over the place could be and Admin nightmare. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 16, 2011 6:04 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
What is the underlying Unix function that WMB is using to generate these syslog messages?
Is there any form of BIP error message suppression configurable in WMB? |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Dec 16, 2011 6:20 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
How about something like...
As an aside...
I got fed up with wading through reams of event logs and we didn't have Tivoli so I wrote a little message flow that reads the wmbevent.log file and does some slightly hacky parsing of it and finally puts it all into a DB table. Many of the more common BIP Codes are parsed by the flow. I know this is a big sledgehammer to crack a small nut but it seems to work pretty well.
I've diagnosed a whole slew of problems with the output. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 16, 2011 7:39 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Dec 16, 2011 7:43 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
mqjeff,
I'm sure that Zpat is already doing that. BUT
any other application running on the same box and writing to syslog with the same attributes will endup in the same log file as the broker stuff.
I seem to recall somewhere reading about some scripting wizzadry that would filter the logfile contents. But this was many years ago now. I could be dreaming though. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Fri Dec 16, 2011 7:50 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
You can perhaps set for example cron job to filter(with grep for example) your logs almost as you want or use for example java to build you own service that does the magic for you.
--
Marko |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 16, 2011 7:51 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
On that tech note it says
Quote: |
Instead of outputting these messages to a log file, you should be able to redirect the syslog output to a shell script or other mechanism for filtering these messages as they are output. |
Does this mean the syslog.conf can directly call a script?
Or that a script has to process the "raw" log file into another "filtered" log file? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 16, 2011 7:52 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
smdavies99 wrote: |
mqjeff,
I'm sure that Zpat is already doing that. BUT
any other application running on the same box and writing to syslog with the same attributes will endup in the same log file as the broker stuff.
I seem to recall somewhere reading about some scripting wizzadry that would filter the logfile contents. But this was many years ago now. I could be dreaming though. |
I think we're saying the same thing?
You just need to alter syslog.conf to write to a PIPE that then calls a shell script. That script could basically be as simple as one grep for BIP* and one grep -v for BIP*...
I.e. if it contains a BIP code, then it's a broker message and write it one place. If it doesn't contain a BIP code then it's not a broker message and write it somewhere else.
Not really "script wizzardry". |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 16, 2011 7:55 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
zpat wrote: |
Does this mean the syslog.conf can directly call a script? |
You would have it write to a PIPE.
Code: |
user.info |/var/log/myscript |
or something similar. |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 16, 2011 8:05 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
So it passes the message as a single parameter (e.g. in quotes) to the script if I do that?
Out of interest do people generally use different log files for ERR, INFO and DEBUG?
Also if use pipe - then will I lose the use of the syslog.conf feature to rotate files.
My current entry is
Code: |
user.* /var/mqsi/error.log rotate size 10m files 5 |
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Dec 16, 2011 8:25 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Yes, you would lose the use of syslog's normal log rotation features. That doesn't mean you couldn't pipe it to something that handled the log rotation (apache's logrotate, for example...) or have your script handle the rotation... or have your script pipe it to something that handles the log rotation... |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Dec 16, 2011 8:34 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Not sure why you want to mess up the system's log when you could use log4j from ESQL to log messages. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
zpat |
Posted: Fri Dec 16, 2011 8:37 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
These are WMB messages (BIP) - are you saying that these can be suppressed or handled silently?
Example of code (is it HANDLE EXCEPTION)? |
|
Back to top |
|
 |
lancelotlinc |
Posted: Fri Dec 16, 2011 8:50 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
I'm suggesting you put logging statements in your ESQL code to log various data that is important to you.
I would not burden syslog with all that information, so I would not use WMB system logging as a first resort, to figure out why my program is behaving the way it does. As my first resort, I would instrument my ESQL code with log statements and control the level of logging at runtme through log4j.properties file. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
|