Thanks Gary! I will update after trying with 2.3. I have a mild idea on what may be going wrong. My requirement is that I need userdefined id (messageid) and configuration based structured data.
1. Messageid is only parsed in log4j if the message is an instance of StructuredDataMessage, hence I am forced to send my message to log4j as structuredDataMessage with empty Map for structured data 2. As a result, the final message gets parsed indexed with two maps, once from the config file and other from the message itself Thanks, Priya Ahuja On Mon, Sep 14, 2015 at 7:57 PM, Gary Gregory <[email protected]> wrote: > Can you try version 2.3 or 2.4 out of Git master? > > Gary > > On Tue, Aug 4, 2015 at 1:41 PM, Priya Ahuja <[email protected]> wrote: > > > Hi Gary, > > > > I am currently using version 2.1. > > > > I have attached the log4j configuration file. > > > > Thanks, > > Priya Ahuja > > > > > > > > On Tue, Aug 4, 2015 at 12:36 PM, Gary Gregory <[email protected]> > > wrote: > > > >> Hi Priya, > >> > >> What is your configuration? What version are you using? > >> > >> Gary > >> > >> On Tue, Aug 4, 2015 at 12:30 PM, Priya Ahuja <[email protected]> > >> wrote: > >> > >> > Hi, > >> > > >> > I am trying to add structured data using includeMDC and loggerfields > >> but I > >> > also want MESSAGE-ID passed by the user in the log. > >> > > >> > *My current implementation:* > >> > I am passing StructuredDataMessage to logIfEnabled since that is the > >> only > >> > way to pass user defined message-id > >> > - StructuredDataMessage((String)null, msg, messageId) > >> > > >> > But I want the structured data picked up from* XML configuration:* > >> > > >> > <Syslog name="RFC5424" format="RFC5424" enterpriseNumber=6876 > >> > * id="LS" includeMDC="true" mdcId="enterprise"* > >> > mdcIncludes="comp,subcomp"> > >> > <LoggerFields> > >> > <KeyValuePair key="level" value="dummy" /> > >> > <KeyValuePair key="id" value="dummy" /> > >> > </LoggerFields> > >> > > >> > As a result my structured data appears twice in the log: > >> > <182>1 2015-08-03T20:28:16.413Z localhost - - USER *[enterprise@6876 > >> > level="dummy" id="dummy"][@6876] *This is a dummy log > >> > > >> > Any help appreciated. > >> > > >> > Thanks, > >> > Priya Ahuja > >> > > >> > >> > >> > >> -- > >> E-Mail: [email protected] | [email protected] > >> Java Persistence with Hibernate, Second Edition > >> <http://www.manning.com/bauer3/> > >> JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> > >> Spring Batch in Action <http://www.manning.com/templier/> > >> Blog: http://garygregory.wordpress.com > >> Home: http://garygregory.com/ > >> Tweet! http://twitter.com/GaryGregory > >> > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > > > -- > E-Mail: [email protected] | [email protected] > Java Persistence with Hibernate, Second Edition > <http://www.manning.com/bauer3/> > JUnit in Action, Second Edition <http://www.manning.com/tahchiev/> > Spring Batch in Action <http://www.manning.com/templier/> > Blog: http://garygregory.wordpress.com > Home: http://garygregory.com/ > Tweet! http://twitter.com/GaryGregory >
