mauryat
mauryat

Reputation: 1646

Logging JBoss request/response ONLY using log4j

How can JBoss requests/responses ONLY be logged using log4j?

For my 3-tiered application (client, web-service and database), I'm trying to gather request/response times.

For instance, timestamps before/after:

  1. Client sends request
  2. WS receives request
  3. WS sends query to database

Currently, my log displays several thousand lines of text (DEBUG mode). But, I'm looking only for request/response information.

I suppose I could choose a different log level, but I'm not able to find my log4j.xml that most solutions are referring to (server/xxx/conf/jboss-log4j.xml). The log4j.properties file in my Eclipse for some reason is not allowing edits.

I'm new to JBoss; in fact inherited the current setup from somebody else, so I'm a little clueless about the entire JBoss thing.

Edit 1

Examples of log4j.properties can be found here.

Edit 2

My log4j.properties:

log4j.rootLogger=TRACE, file
log4j.appender.file=org.apache.log4j.RollingFileAppender
log4j.appender.file.File=C\:log4j.log
log4j.appender.file.MaxFileSize=1MB
log4j.appender.file.MaxBackupIndex=1
log4j.appender.file.layout=org.apache.log4j.PatternLayout
log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.category.org.springframework.beans.factory=DEBUG

Upvotes: 0

Views: 1654

Answers (1)

James R. Perkins
James R. Perkins

Reputation: 17760

It's probably best to configure logging through the logging subsystem. If you're looking to use your a log4j configuration file, see the instructions here.

Upvotes: 1

Related Questions