logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edmondo Porcu <Edmondo.Po...@gottexbrokers.com>
Subject Programmatically create a ConsoleAppender
Date Mon, 13 Feb 2012 09:31:03 GMT
Dear all,
I have a test-case where I want to add extra logging compared to my normal logging settings.

I have therefore create manually an appender, and add that to a logger. However, 
PRIORITY.DEBUG is deprecated.

I am probably missing some information about how to add extra logging:

  private final val mockRealTimeLogger= Logger.getLogger("MockRealTimeConnectorLogger")
  mockRealTimeLogger.setLevel(Level.DEBUG)
  val appender = new ConsoleAppender(new PatternLayout("%d{ABSOLUTE} [%t] %-5p %c{1} - %m%n"));
  appender.setThreshold(Priority.DEBUG)
  mockRealTimeLogger.addAppender(appender)


Isn't this good? 

Thank you very much

Edmondo Porcu
Associate - Financial  software architect



Avenue de Rhodanie 48
1007 Lausanne
Switzerland.

Dir  +41 (0) 21  560 30 82
Fax +41 (0) 21  617 71 55
Email : edmondo.porcu@gottexbrokers.com

The information in this email is confidential and may be legally privileged. If you are not
the intended recipient, you must not read, use or disseminate the information. Although this
email and any attachments are believed to be free of any virus or other defect that might
affect any computer system into which it is received and opened, it is the responsibility
of the recipient to ensure that it is virus free and no responsibility is accepted by the
Gottex Group of Companies for any loss or damage arising in any way from its use.



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


Mime
View raw message