on ‎2018 Nov 21 11:02 AM
I have a custom Class with
package de.my.package.messagesource.services.impl;
private static final Logger LOG = Logger.getLogger(DefaultSystemResourceService.class);
LOG.warn(new StringBuilder("SystemResource with code '").append(code).append("' not found!").toString());
Now i insert in hac:
log4j.appender.de.my.package.messagesource.services.impl=false log4j.logger.de.my.package.messagesource.services.impl=ERROR
But I still see the Outputs in Terminal. How can I avoid that?
Greatings David
Request clarification before answering.
Please try the following configuration:
log4j.logger.de.my.package.messagesource.services.impl=OFF
Also, please add it to local.properties file so that it can be loaded automatically on the next server restart.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you are using the newer versions, the syntax is a bit different. It's like this:
log4j2.logger.AnyLabel.name = org.apache.solr
log4j2.logger.AnyLabel.level = ERROR
log4j2.logger.AnyLabel.additivity = false
log4j2.logger.AnyLabel.appenderRef.stdout.ref = STDOUT
You can change AnyLabel to anything you like.
Reference:
Upgrading to Log4j 2: https://help.hybris.com/1808/hcd/42d818c7bac44eed9ab01757472b9dbc.html
( If it works, don't forget to Upvote and Accept. )
For the old logger, this should work:
log4j.rootLogger=INFO, CONSOLE
log4j.appender.CONSOLE.layout.ConversionPattern=%-5p [%t] %X{RemoteAddr}%X{Tenant}%X{CronJob}[%C.%M:%L] %m%n
log4j.logger.org.apache.solr=ERROR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.