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 » WebSphere Message Broker (ACE) Support » Logging to a file constraints - WMB8

Post new topic  Reply to topic
 Logging to a file constraints - WMB8 « View previous topic :: View next topic » 
Author Message
Lucky
PostPosted: Mon Jul 08, 2013 11:31 pm    Post subject: Logging to a file constraints - WMB8 Reply with quote

Apprentice

Joined: 06 Feb 2007
Posts: 35

Hi All,

We have a message flow and seperate logging subflow which will write all the incoming msgs to a file. Currently we are appending each message to a single file and new file is created for each day.

We are asked to implement as below:
Write message to file(say file1) until it reach 1MB size. Once file1 reaches 1MB then create new file file2 and write it till 1MB size and this has to go on till we reach file10. After this we need to rewrite the data in file1 after it reaches 1MB, rewrite file2 etc... Something like circular logging into 10 files with file size to be 1MB.

Let me know how this can be implemented using WMB 8.0.0.1.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 09, 2013 12:24 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

What you are asking is remarkably similar to this post
[url]
http://www.mqseries.net/phpBB2/viewtopic.php?t=64725
[/url]

Are you by any chance working on the same project?

BTW, logging to files is so very '1990's'. There are far better ways to log incoming and outgoing data. It is also common practice in Java shops where they seem to use Log4j everywhere.

If you think about it, you could put together a solution that allows you to link the incoming message and the outgoing message. Doing this really helps finding errors in the system.
_________________
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
View user's profile Send private message
Tibor
PostPosted: Tue Jul 09, 2013 9:48 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

You can use the syslog facility on Unix / Linux platform and in case of that there are some method for setting its behavior, depenpent by the platform and syslog engine.

By the way, if you are familiar in log4j, this is your best, as it was recommended by smdavies99.
Back to top
View user's profile Send private message
lancelotlinc
PostPosted: Tue Jul 09, 2013 9:58 am    Post subject: Reply with quote

Jedi Knight

Joined: 22 Mar 2010
Posts: 4941
Location: Bloomington, IL USA

Log4j comes with various file appenders. My favorite is DailyRollingFileAppender.
_________________
http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER
Back to top
View user's profile Send private message Send e-mail
mqjeff
PostPosted: Tue Jul 09, 2013 10:46 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

java.util.logging is just as functional as log4j, and requires far less configuration and management from a Broker point of view.

No need to worry about classpaths, classloaders or jar files!
Back to top
View user's profile Send private message
smdavies99
PostPosted: Tue Jul 09, 2013 10:46 am    Post subject: Reply with quote

Jedi Council

Joined: 10 Feb 2003
Posts: 6076
Location: Somewhere over the Rainbow this side of Never-never land.

Tibor wrote:


By the way, if you are familiar in log4j, this is your best, as it was recommended by smdavies99.


I did not and never would recommend Log4j. IT has many problems as have been documented here several times. I used it as an example of the sort of thing a Java dev would use and I'm certainly not one of them (like Vitor )

What I was trying to point out is that Logging to files is so old fashioned and frankly there are far better ways to acheive a record of inputs and outputs.

One disadvantage of Log4j is that you are typically writting t oa fairly slow medium. That may slow down overall throughput of your system.
_________________
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
View user's profile Send private message
Tibor
PostPosted: Tue Jul 09, 2013 11:26 am    Post subject: Reply with quote

Grand Master

Joined: 20 May 2001
Posts: 1033
Location: Hungary

smdavies99 wrote:
One disadvantage of Log4j is that you are typically writting to a fairly slow medium.

Hmmm, I don't think so writing to a file (in the local filesystem) would be slow, comparing to any other option, e.g. calling an SQL UPDATE, etc.
Back to top
View user's profile Send private message
goffinf
PostPosted: Tue Jul 09, 2013 1:38 pm    Post subject: Reply with quote

Chevalier

Joined: 05 Nov 2005
Posts: 401

Tibor wrote:
smdavies99 wrote:
One disadvantage of Log4j is that you are typically writting to a fairly slow medium.

Hmmm, I don't think so writing to a file (in the local filesystem) would be slow, comparing to any other option, e.g. calling an SQL UPDATE, etc.


Especially since you would typically use a buffered asynch appender.

Fraser.
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 » WebSphere Message Broker (ACE) Support » Logging to a file constraints - WMB8
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.