Topic
  • 2 replies
  • Latest Post - ‏2012-04-23T10:16:33Z by SystemAdmin
SystemAdmin
SystemAdmin
1299 Posts

Pinned topic More about LOG4J

‏2012-04-23T08:46:53Z |
Hi,

I previously replied to a thread about logging (https://www.ibm.com/developerworks/forums/thread.jspa?threadID=272012&tstart=0) but I think my next question probably belongs in a new post.

As part of some template debugging I'm working on, I was looking to direct some messages to specific LOG4J contexts (e.g. INFO, DEBUG etc) which I was able to do with a little help from Dragos:

---
var logger = com.ibm.rational.rpe.common.utils.AppUtils.getLogger();
logger.debug( ">>> Some debug message");
logger.info( ">>> Some info message");
logger.warn( ">>> Some warning message");
logger.error( ">>> Some error message");
---

I noticed however that these log messages are not preceded by the alphanumeric identifier that regular RPE log messages display, e.g.:

CRRPE1064I Processed 3000 input elements
CRRPE3094I 7000 output commands processed. 0 remaining.

Which leads me to my first question: what exactly are these IDs? My hunch is that they relate to RPE worker threads/processes that to some degree independently process XML. Is this correct?

My second question: is it possible to get these IDs via Javascript, such that custom log4j messages follow the same convention of identifying their parent thread/process?
Many thanks,
Alex
Updated on 2012-04-23T10:16:33Z at 2012-04-23T10:16:33Z by SystemAdmin
  • Dragos.Cojocari
    Dragos.Cojocari
    1647 Posts

    Re: More about LOG4J

    ‏2012-04-23T08:56:56Z  
    Hey Alex,

    >>> Which leads me to my first question: what exactly are these IDs? My hunch is that they relate to RPE worker threads/processes that to some degree independently process XML. Is this correct?
    These are internal RPE message identifiers. They are not related to the threads but to the actual message. Their main purpose is to allow a precise identification of the message's source and location in code and not rely on the message's text.

    >>> My second question: is it possible to get these IDs via Javascript, such that custom log4j messages follow the same convention of identifying their parent thread/process?
    No. If you want to use consistent message you could define your own unique identifiers per message.

    Regards,
    Dragos

    RPE Actual
  • SystemAdmin
    SystemAdmin
    1299 Posts

    Re: More about LOG4J

    ‏2012-04-23T10:16:33Z  
    Hey Alex,

    >>> Which leads me to my first question: what exactly are these IDs? My hunch is that they relate to RPE worker threads/processes that to some degree independently process XML. Is this correct?
    These are internal RPE message identifiers. They are not related to the threads but to the actual message. Their main purpose is to allow a precise identification of the message's source and location in code and not rely on the message's text.

    >>> My second question: is it possible to get these IDs via Javascript, such that custom log4j messages follow the same convention of identifying their parent thread/process?
    No. If you want to use consistent message you could define your own unique identifiers per message.

    Regards,
    Dragos

    RPE Actual
    Thanks Dragos; I'll implement my own unique IDs :-)