log4j

Why is Grails (in Tomcat) logging to both catalina.out and my custom file appender?

I have the following for my log4j DSL configuration in Grails 1.2: log4j = { appenders { console name: 'stdout', layout: pattern(conversionPattern: conversionPattern) environments { production { // ... some code to determine file path ... rollingFile name: 'file', file: "...

Log4J config for Spring JTA transactions

We use this Log4J config to display JTA info: <category name="org.springframework.transaction"> <priority value="DEBUG"/> </category> The resulting log entries are of the type: 15:36:08,048 DEBUG [JtaTransactionManager] [ ] Creating new transaction with name [class]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT 15:36:09,564 DEBUG [Jta...

A Maven2 mojo that uses Hibernate: how to control logging?

I have a maven2 plugin that calls hibernate as configured in a Spring context. Hibernate, of course, logs. I'm trying to control the logging. 0 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.2.6 So, I explicitly put slf4j into the plugin's dependencies, along with the log4j package. And I configure Spring to use log4j, ...

Is it possible to disable traces printed to console in JBoss 5.1?

By default there are two appenders in JBoss5.1 - CONSOLE and FILE. Do we need to use both of these appenders in production? Is it possible to use FILE appender only? I removed CONSOLE appender from web\conf\jboss-log4j.xml but there are still a lot of traces in console. Why? I do not want traces in console in production. Is it possibl...

Category VS logger tags in jboss-log4j.xml

What should we use in jboss-log4j.xml in order to turn on/off traces for our product - "category" or "logger" tag? By default JBoss uses "category" in jboss-log4j.xml. But as far as I know "category" is deprecated and "logger" should be used instead. Why JBoss uses deprecated "category" tag in a new product? ...

What is an appropriate way to separate lifecycle events in the logging system?

I have an application with many different parts, it runs on OSGi, so there's the bundle lifecycles, there's a number of message processors and plugin components that all can die, can be started and stopped, have their setup changed etc. I want a way to get a good picture of the current system status, what components are up, which have p...

log4j - when to use PropertyConfigurator in tests?

Hi, I know you're supposed to only load log4j properties once, so what is standard practice when you're doing unit tests? Should I load it in every unit test file? Should I put it in jUnit's setUp() method? Thanks ...

a way to use log4j pass set flags in my code

I need to pass some value to enable certain code in may app (in this case is to optionally enable writing some stats to a file in certain conditions, but it might be anything generally). My java app is installed as a service. So every way I have thought of has some drawbacks: Add another param to main(): cumbersome as customers alread...

log4j rootLogger seems to inherit log level of other logger. Why?

I've got a log4J setup in which the root logger is supposed to log ERROR level messages and above to the console and another logger logs everything to syslog. log4j.properties is: # Root logger option log4j.rootLogger=ERROR,R log4j.appender.R=org.apache.log4j.ConsoleAppender log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j...

How to mask credit card numbers in log files with Log4J?

Our web app needs to be made PCI compliant, i.e. it must not store any credit card numbers. The app is a frontend to a mainframe system which handles the CC numbers internally and - as we have just found out - occasionally still spits out a full CC number on one of its response screens. By default, the whole content of these responses ar...

How to make graph from perf4j log file?

I have used perf4j to calulate the performance of the process. Now I want to make the graph for that file. Is it possible to make it without using google API or any other metohd that can be used Thank You ...

Turn off Hibernate Logs for certain query

Can you turn off log messages for certain query in Hibernate / EJB 3.0? Is there a way to override the parameter "hibernate.show_sql" for just a single query? ...

Graph for perf4j on per request basis

Hello, I am trying to plot the graph along with the log file of it. The graph is being plotted but in the perf4j log file it asks for the updates even when the the count is 0. How can it be stopped. Moreover if I want to plot the graph on per request basis on the browser, Can it be done and how? Thank You ...

Log4j: How filter out messages from a specific class?

I want to configure my log4j logging to not log messages that are 1) coming from a specific class and 2) of a specific severity i.e. WARN. Can someone provide sample configuration/code on how to do this? ...

Make graph of perf4j on the basis of request and maintain every day request performance

Hello, I want to make graph of perf4j on the basis of request and not on the basis of timeslice as shown when graph drawn for perf4j. How can the graph be drawn and maintained for current and past requests without using timeslice? Thank You ...

Where will I find the tutorial for perf4j

Where will I find the tutorial for perf4j? ...

Is there any other parameter other than timeslicing in perf4j

Is there any other parameter other than timeslicing in perf4j against which graph can be drawn Thank You ...

I already have the log file. How can I make a graph of it?

Hello, I already have log file. Now what i need is to make the graph of that log file. Is there any command line tool or google API to make graph which will show every transaction time. Thank You ...

Why is log4j not behaving as expected?

I have a co-worker who is trying to get log4j to behave as follows: Log to Stdout By default, disable most output Show only messages from java.sql.PrepareStatement at level debug and up He's getting caught up in the 'level' vs 'priority'. Here is his config file: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE log4j:configuration ...

Separate log files for each web application and shared libraries with log4j

I have few web applications run on the Tomcat server. Each application contains its own log4j library copy inside its own war. This allows for separate, flexible logging configuration per application. I also have few shared libraries (kept in Tomcat's shared libraries directory). I would like to have shared library loggers output among...