LogManager.getFormatterLogger() - no arg method?

2015-08-04 Thread Greg Thomas
Apologies if this has been asked before, but is there a good reason why
there is a LogManager.getLogger() method with no args that returns a Logger
with the name of the calling class, but there is not a matching
LogManager.getFormatterLogger() with similar functionality for a
formatterLogger?

Is it just an omission that no-one has bothered to correct, yet, or
something deeper?

Thanks,

Greg


Re: LogManager.getFormatterLogger() - no arg method?

2015-08-04 Thread Greg Thomas
Heh, OK, someone is way ahead of me :)

Thanks

On 4 August 2015 at 15:53, Gary Gregory garydgreg...@gmail.com wrote:

 Greg,

 Such a method is in Git master, which will be included in the upcoming 2.4
 release.

 Gary

 On Tue, Aug 4, 2015 at 7:12 AM, Greg Thomas greg.d.tho...@gmail.com
 wrote:

  Apologies if this has been asked before, but is there a good reason why
  there is a LogManager.getLogger() method with no args that returns a
 Logger
  with the name of the calling class, but there is not a matching
  LogManager.getFormatterLogger() with similar functionality for a
  formatterLogger?
 
  Is it just an omission that no-one has bothered to correct, yet, or
  something deeper?
 
  Thanks,
 
  Greg
 



 --
 E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
 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



Re: LogManager.getFormatterLogger() - no arg method?

2015-08-04 Thread Gary Gregory
Feel free to keep on digging, file bugs, provide patches, and whatnot. ;-)

Gary

On Tue, Aug 4, 2015 at 7:54 AM, Greg Thomas greg.d.tho...@gmail.com wrote:

 Heh, OK, someone is way ahead of me :)

 Thanks

 On 4 August 2015 at 15:53, Gary Gregory garydgreg...@gmail.com wrote:

  Greg,
 
  Such a method is in Git master, which will be included in the upcoming
 2.4
  release.
 
  Gary
 
  On Tue, Aug 4, 2015 at 7:12 AM, Greg Thomas greg.d.tho...@gmail.com
  wrote:
 
   Apologies if this has been asked before, but is there a good reason why
   there is a LogManager.getLogger() method with no args that returns a
  Logger
   with the name of the calling class, but there is not a matching
   LogManager.getFormatterLogger() with similar functionality for a
   formatterLogger?
  
   Is it just an omission that no-one has bothered to correct, yet, or
   something deeper?
  
   Thanks,
  
   Greg
  
 
 
 
  --
  E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
  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
 




-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
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


Re: LogManager.getFormatterLogger() - no arg method?

2015-08-04 Thread Gary Gregory
Greg,

Such a method is in Git master, which will be included in the upcoming 2.4
release.

Gary

On Tue, Aug 4, 2015 at 7:12 AM, Greg Thomas greg.d.tho...@gmail.com wrote:

 Apologies if this has been asked before, but is there a good reason why
 there is a LogManager.getLogger() method with no args that returns a Logger
 with the name of the calling class, but there is not a matching
 LogManager.getFormatterLogger() with similar functionality for a
 formatterLogger?

 Is it just an omission that no-one has bothered to correct, yet, or
 something deeper?

 Thanks,

 Greg




-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
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


Re: Structured data appearing twice

2015-08-04 Thread Gary Gregory
Hi Priya,

I would start by updating to 2.3 and then test again. If not fixed look, in
changes.xml [1] in Git master to see if this has been fixed in the upcoming
2.4 release:

Gary

[1]
https://git-wip-us.apache.org/repos/asf?p=logging-log4j2.git;a=blob_plain;f=src/changes/changes.xml;hb=HEAD

On Tue, Aug 4, 2015 at 1:41 PM, Priya Ahuja priahuja...@gmail.com 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 garydgreg...@gmail.com
 wrote:

 Hi Priya,

 What is your configuration? What version are you using?

 Gary

 On Tue, Aug 4, 2015 at 12:30 PM, Priya Ahuja priahuja...@gmail.com
 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:
  1821 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: garydgreg...@gmail.com | ggreg...@apache.org
 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: log4j-user-unsubscr...@logging.apache.org
 For additional commands, e-mail: log4j-user-h...@logging.apache.org




-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
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


Structured data appearing twice

2015-08-04 Thread Priya Ahuja
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:
1821 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


Re: Structured data appearing twice

2015-08-04 Thread Gary Gregory
Hi Priya,

What is your configuration? What version are you using?

Gary

On Tue, Aug 4, 2015 at 12:30 PM, Priya Ahuja priahuja...@gmail.com 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:
 1821 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: garydgreg...@gmail.com | ggreg...@apache.org
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


Re: Structured data appearing twice

2015-08-04 Thread Priya Ahuja
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 garydgreg...@gmail.com
wrote:

 Hi Priya,

 What is your configuration? What version are you using?

 Gary

 On Tue, Aug 4, 2015 at 12:30 PM, Priya Ahuja priahuja...@gmail.com
 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:
  1821 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: garydgreg...@gmail.com | ggreg...@apache.org
 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

?xml version=1.0 encoding=UTF-8?

Configuration monitorInterval=30 status=FATAL shutdownHook=disable
Appenders
Syslog name=RFC5424 format=RFC5424
host=${bundle:syslog.server.host}
port=${bundle:syslog.server.port}
protocol=${bundle:syslog.server.protocol}
appName=${bundle:syslog.app_name}
facility=${bundle:syslog.facility.log4j}
enterpriseNumber=${bundle:syslog.enterprise_number} newLine=true
id=LS includeMDC=true mdcId=enterprise
mdcIncludes=level,id  
LoggerFields 
KeyValuePair key=level value=dummy /
KeyValuePair key=id value=dummy / 
/LoggerFields
ThresholdFilter level=INFO/
/Syslog
/Appenders
Loggers
Root level=INFO
AppenderRef ref=RFC5424”/ !-- Do not remove Syslog appender --
/Root
/Loggers
/Configuration

-
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org