Rocky,

I will try...

Your logging API would have to use Resource Bundles, and I am quite certain
that Log4J does not use them. But I could be wrong....


Your test class ....

public class WmJournalLogger189421Test extends TestCase {

        static final String BUNDLE_BASE_NAME =
"com.webmethods.sc.logging.log4j.resources.MyResourceBundle";


Your test method ...

public void test2() throws Exception {
                /**
                 * Test log( inLevel, inKey, inParam, (Throwable)null,
                 * (LogMessageContext)null )
                 */

                LoggingConfigParams lcp = ConfigParamsXml
                                .configFromXmlFile("config2.xml");
                WmLogManager.getDefault().applyParams(lcp);
                SampleResourceBundle.getBundle(BUNDLE_BASE_NAME);

                LoggerFactoryContext factCtx =
LoggerFactoryContext.getInstance("ID",
                                "TYPE", "webm.sc.sample.sub2", "./log");
                WmLoggerFactory fact = WmLoggerFactory.getInstance(factCtx);

                WmJournalLogger theLogger2 = fact.create(
                                "com.webmethods.sc.logging.log4j.messages",
cloader, "COMP_ID",
                                "SUB_COMP_ID", LOGGER_NAME);

                LogMessageContext lmc = LogMessageContext.getInstance();

                theLogger2.getLog4jLogger().setAdditivity(false);

                theLogger2.log(Level.DEBUG, "WmLogManager.NullLogDir",
"IN_PARAMS", e,
                                lmc);

        }

Now, as you can see <Logger>.log method has " WmLogManager.NullLogDir" in
the argument, this argument is declared in the messages.properties file in
the logging package

Hope this helps.

-Kamal.


-----Original Message-----
From: Martinez, Roque [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2006 11:04 AM
To: Log4J Users List
Subject: RE: Messaging Mapping?

Kamal;

Thanks for the quick response, but I am not sure how the logging code would
look like.
I know you are busy like all of us in this great industry, but could you be
a little more elaborate in your explanation.

Thanks
Rocky

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
On Behalf Of Kamal Ahmed
Sent: Tuesday, December 19, 2006 10:38 AM
To: Log4J Users List
Subject: RE: Messaging Mapping?

Rocky,

Try using Resource Bundles and messages.properties 
The mapping is done in messages.properties file
Here is a sample:

G8dEvent.NullSourceType='source type id' must not be null
WmTimedFileAppenderBase.NullDatePattern=DatePattern option is not set for
appender {0}, using default: {1}
WmLogManager.NullLogDir=Log file directory cannot be null

-----Original Message-----
From: Martinez, Roque [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, December 19, 2006 10:31 AM
To: [email protected]
Subject: Messaging Mapping?

All;

 

I have been doing some research and I keep coming across a thread in this
mailing list which describes how to map messages to a specific text. I
notice the implementation requires a number of constructions each time a log
message is being created. I am wondering if anyone has been able to create a
different methodology to accomplish the same.

 

Example IO100-01 becomes IO100-01 File not found File Name: test.properties

 

Thanks

Rocky

 

 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to