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 Strings

Post new topic  Reply to topic
 Logging Strings « View previous topic :: View next topic » 
Author Message
Pratik611
PostPosted: Wed Mar 11, 2015 2:43 am    Post subject: Logging Strings Reply with quote

Novice

Joined: 27 Jul 2014
Posts: 17

Hi Guys,
Wanted to know weather storing strings in multiple environment variables is better than concatenating it all in one variable?
Both these variables will be used for logging using a Trace node!
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Mar 11, 2015 4:39 am    Post subject: Re: Logging Strings Reply with quote

Grand High Poobah

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

Pratik611 wrote:
Wanted to know weather storing strings in multiple environment variables is better than concatenating it all in one variable?


They're both equally bad.

Pratik611 wrote:
Both these variables will be used for logging using a Trace node!


and that's worse.

Use Trace nodes for tracing. Don't use them for logging. Use something better and more effecient (i.e. anything).
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
smdavies99
PostPosted: Wed Mar 11, 2015 5:38 am    Post subject: Re: Logging Strings Reply with quote

Jedi Council

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

Pratik611 wrote:

Both these variables will be used for logging using a Trace node!


Back in the days of V2.0.2 & V2.1 Trace nodes were just about all that we had. Now the situation is very different.
There are many solutions for logging including 'Log4J' (shudder, no please no, not Log4j, anything but Log4J.)

It all comes down to what you want to log.

Any well established project will have a well established logging framework that makes life easy.

Think very seriously about logging to files. Think how it might be used in production? how big will they get? What about logfile rotation? etc etc etc etc.

A good few of us here write log/audit/error events to DB tables. Then a batch job can run to purge the old stuff.
_________________
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
Vitor
PostPosted: Wed Mar 11, 2015 6:07 am    Post subject: Re: Logging Strings Reply with quote

Grand High Poobah

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

smdavies99 wrote:
There are many solutions for logging including 'Log4J' (shudder, no please no, not Log4j, anything but Log4J.)


Log4j is better Than a trace node.

Javax.util.logging is better than log4j (the Java people tell me).

DB tables are cool.

etc.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Mar 11, 2015 6:07 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If you need to access the fields individually, you should store them as separate variables.

If you only ever need to access them collectively, you should store them as a single value, concatenated.

The only reason to really sweat the difference between these is if you are optimizing your code to seven decimal points... and then you've already wasted your time optimizing to 5 decimal points, so you might as well give up.

Otherwise. Don't use trace nodes for logging!

If for no other reason than that a trace node keeps an exclusive lock on the file it's writing to, so that you have to go in and muck with the actual contents to shrink the file without stopping the flow...

And don't use log4j. Use java.util.logging, if you really want to do logging from Java in IIB.
Back to top
View user's profile Send private message
joebuckeye
PostPosted: Wed Mar 11, 2015 8:39 am    Post subject: Reply with quote

Partisan

Joined: 24 Aug 2007
Posts: 365
Location: Columbus, OH

mqjeff wrote:
If for no other reason than that a trace node keeps an exclusive lock on the file it's writing to, so that you have to go in and muck with the actual contents to shrink the file without stopping the flow...


An easy way to "deal" with trace files is to do a "cp /dev/null <trace file>". That zeroes the file out without causing the node to "lose" the file.

Of course we only use trace nodes for debugging while developing and not as any part of a production logging solution.
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 Strings
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.