ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General Discussion » Redirecting the system logs to user log file in AIX

Post new topic  Reply to topic
 Redirecting the system logs to user log file in AIX « View previous topic :: View next topic » 
Author Message
binitg
PostPosted: Tue Apr 21, 2009 4:34 am    Post subject: Redirecting the system logs to user log file in AIX Reply with quote

Newbie

Joined: 21 Apr 2009
Posts: 7

On Linux and UNIX systems, all webSphere Message Broker Messages (other than those generated by the command line utilities) are sent to the syslog, so we need to redirect the user messages to a separate file. We need to configure the syslog daemon (syslog is a standard for forwarding log messages in an IP network) to redirect the user messages to a file called user.log.

Can anyone plz suggest how do we specify a filter and redirect only Broker logs to user.log ?
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 21, 2009 4:41 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

Since you have double-posted, so shall I.

It's impossible to do this.

Or it's possible to do this, but you have to be an expert in Message Broker and you have to know how to change the syslog code and recompile it.

Or it's possible to do this, but you have to be a fully certified Unix System Administrator to know how to do it, because you have to adjust kernel settings.

Or it's possible to do this, it's dead simple to do, and fully documented in the relevant topic of the Message Broker Info Center.

You can guess which one is true, or you can Please Try Harder.
Back to top
View user's profile Send private message
WMBDEV1
PostPosted: Tue Apr 21, 2009 4:48 am    Post subject: Reply with quote

Sentinel

Joined: 05 Mar 2009
Posts: 888
Location: UK

mqjeff wrote:
Since you have double-posted, so shall I.



Well spotted Jeff, I thought that it was just two brand new distinct users describing word for word the same issue at the same time.

Seriously though, it must have taken time to create two users and post the same question. What was the poster thinking?
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 21, 2009 4:50 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

WMBDEV1 wrote:
What was the poster thinking?


There's evidence of thought?
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
binitg
PostPosted: Tue Apr 21, 2009 4:55 am    Post subject: Reply with quote

Newbie

Joined: 21 Apr 2009
Posts: 7

mqjeff wrote:
Since you have double-posted, so shall I.

It's impossible to do this.

Or it's possible to do this, but you have to be an expert in Message Broker and you have to know how to change the syslog code and recompile it.

Or it's possible to do this, but you have to be a fully certified Unix System Administrator to know how to do it, because you have to adjust kernel settings.

Or it's possible to do this, it's dead simple to do, and fully documented in the relevant topic of the Message Broker Info Center.

You can guess which one is true, or you can Please Try Harder.


Hi,
I went through the documentation in info center but that doesnot sounded more convencing. I am just wondering how do I apply a filter to redirect only Broker related logs to user.log.

Below is the sol given to configure syslog in Info Centre
STEPS to configure the user log:
1) Log on as root:
2) Enter the following command to create a file called user.log

touch /var/adm/user.log
chown root:mqbrkrs /var/adm/user.log
chmod 640 /var/adm/user.log

3) Add the following line to the /etc/syslog.conf file

user.info /var/adm/user.log

4) Restart the syslog daemon.

refresh -s syslogd
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 21, 2009 5:14 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

binitg wrote:
that doesnot sounded more convencing.


You want a solution that sounds convincing?

In that case you'll need to apply a wrapper to the syslog daemon that holds the Broker Access Log Link Segment in a semaphore, then redirects it via a file system integral into the log file.

If that's convincing enough I'd be happy to quote for the work.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
binitg
PostPosted: Tue Apr 21, 2009 5:23 am    Post subject: Reply with quote

Newbie

Joined: 21 Apr 2009
Posts: 7

Vitor wrote:
binitg wrote:
that doesnot sounded more convencing.


You want a solution that sounds convincing?

In that case you'll need to apply a wrapper to the syslog daemon that holds the Broker Access Log Link Segment in a semaphore, then redirects it via a file system integral into the log file.

If that's convincing enough I'd be happy to quote for the work.


Thanks Victor for the reply. Can you also suggest some commands which would filter out the broker logs to user log file something like the one below

In the syslog configuration file /etc/syslog-ng/syslog-ng.conf.in, add a filter that matches messages from WMB:
filter f_wmb { match('^WebSphere Broker'); };

This will allow for catching all messages from WMB. Now, create a destination where you want your WMB messages to go:
destination wmb { file("/var/log/wmb/messages" group(mqm) perm(0644)); };

In this case, we set the group to be mqm, simply because that’s the group our developers belong
log { source(src); filter(f_wmb); destination(wmb); };

With this setup, all messages coming from WMB will end up in the file /var/log/wmb/messages. To keep /var/log/messages clean, we might also want to strip out WMB messages:

Now, restart the syslog-ng daemon and you should see your WMB message starting to gather in your new file:

/etc/init.d/syslog restart
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 21, 2009 5:25 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

binitg wrote:
Thanks Victor for the reply. Can you also suggest some commands which would filter out the broker logs to user log file


So unconvincing you can't even get my name right; must be losing my touch.....
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 21, 2009 5:36 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

binitg wrote:
I am just wondering how do I apply a filter to redirect only Broker related logs to user.log.


This is a *different* question than the one you asked first.

You first asked
Quote:
We need to configure the syslog daemon (syslog is a standard for forwarding log messages in an IP network) to redirect the user messages to a file called user.log.


The instructions to do THAT, which you asked FIRST, are spelled out entirely in the InfoCenter and you apparently did find that and quoted it.

But your SECOND question, how to direct BROKER messages to a DIFFERENT file than the rest of the USER messages, is NOT answered in the InfoCenter. For that, you do need to be a unix system admin, or at least a power user, and be able to redirect ALL user messages to a PIPE to a SCRIPT that will FILTER broker messages.

Or be a power user of syslog. I don't know what "syslog-ng" is, it apparently has some fancy scripting capabilities built into it from the configuration you have shown.
Back to top
View user's profile Send private message
binitg
PostPosted: Tue Apr 21, 2009 5:41 am    Post subject: Reply with quote

Newbie

Joined: 21 Apr 2009
Posts: 7

Vitor wrote:
binitg wrote:
Thanks Victor for the reply. Can you also suggest some commands which would filter out the broker logs to user log file


So unconvincing you can't even get my name right; must be losing my touch.....


Oh extremely sorry Vitor for that.
Back to top
View user's profile Send private message
binitg
PostPosted: Tue Apr 21, 2009 5:42 am    Post subject: Reply with quote

Newbie

Joined: 21 Apr 2009
Posts: 7

mqjeff wrote:
binitg wrote:
I am just wondering how do I apply a filter to redirect only Broker related logs to user.log.


This is a *different* question than the one you asked first.

You first asked
Quote:
We need to configure the syslog daemon (syslog is a standard for forwarding log messages in an IP network) to redirect the user messages to a file called user.log.


The instructions to do THAT, which you asked FIRST, are spelled out entirely in the InfoCenter and you apparently did find that and quoted it.

But your SECOND question, how to direct BROKER messages to a DIFFERENT file than the rest of the USER messages, is NOT answered in the InfoCenter. For that, you do need to be a unix system admin, or at least a power user, and be able to redirect ALL user messages to a PIPE to a SCRIPT that will FILTER broker messages.

Or be a power user of syslog. I don't know what "syslog-ng" is, it apparently has some fancy scripting capabilities built into it from the configuration you have shown.



Thanks for the reply. Can you plz suggest me some sets of commands to redirect the system logs to user logs (Assuming I have all the rights in AIX box)
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Apr 21, 2009 5:44 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

You already have them.

Back to top
View user's profile Send private message
binitg
PostPosted: Tue Apr 21, 2009 10:33 pm    Post subject: Reply with quote

Newbie

Joined: 21 Apr 2009
Posts: 7

mqjeff wrote:
You already have them.



The commands just redirects all the system logs to user logs. What I need is to filter only BROKER specific logs and redirect them to user log. The only place I have got stuck is the filter portion.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General Discussion » Redirecting the system logs to user log file in AIX
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.