Allow debug and trace log statements to be printed in log files
System logs file appenders were created with an info threshold which was preventing debug and trace log statement to be printed in the files. File appenders should not have a threshold. Instead, the root logger should have a proper level (i.e. info) so if a specific logger is using a finer grain level (e.g. debug, trace), the log statements won't be filtered out by the appender. Set the root category to info and no longer set the file appender threshold when creating system logs. Change-Id: I747bef1f5dcb99784ba91dba6d29cf1fba582b62
This commit is contained in:
parent
8b0e2b0a74
commit
0cbe223e40
@ -25,7 +25,6 @@ import org.apache.log4j.Appender;
|
||||
import org.apache.log4j.AsyncAppender;
|
||||
import org.apache.log4j.DailyRollingFileAppender;
|
||||
import org.apache.log4j.Layout;
|
||||
import org.apache.log4j.Level;
|
||||
import org.apache.log4j.LogManager;
|
||||
import org.apache.log4j.Logger;
|
||||
import org.apache.log4j.helpers.OnlyOnceErrorHandler;
|
||||
@ -64,7 +63,6 @@ public class SystemLog {
|
||||
dst.setFile(new File(resolve(logdir), name).getPath());
|
||||
dst.setImmediateFlush(true);
|
||||
dst.setAppend(true);
|
||||
dst.setThreshold(Level.INFO);
|
||||
dst.setErrorHandler(new DieErrorHandler());
|
||||
dst.activateOptions();
|
||||
dst.setErrorHandler(new OnlyOnceErrorHandler());
|
||||
|
@ -12,14 +12,12 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
#
|
||||
log4j.rootCategory=DEBUG, stderr
|
||||
log4j.rootCategory=INFO, stderr
|
||||
log4j.appender.stderr=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.stderr.target=System.err
|
||||
log4j.appender.stderr.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.stderr.layout.ConversionPattern=[%d] %-5p %c %x: %m%n
|
||||
|
||||
log4j.logger.com.google.gerrit=INFO
|
||||
|
||||
# Silence non-critical messages from MINA SSHD.
|
||||
#
|
||||
log4j.logger.org.apache.mina=WARN
|
||||
@ -28,10 +26,6 @@ log4j.logger.org.apache.sshd.server=WARN
|
||||
log4j.logger.org.apache.sshd.common.keyprovider.FileKeyPairProvider=INFO
|
||||
log4j.logger.com.google.gerrit.sshd.GerritServerSession=WARN
|
||||
|
||||
# Silence non-critical messages from Jetty.
|
||||
#
|
||||
log4j.logger.org.eclipse.jetty=INFO
|
||||
|
||||
# Silence non-critical messages from mime-util.
|
||||
#
|
||||
log4j.logger.eu.medsea.mimeutil=WARN
|
||||
|
Loading…
Reference in New Issue
Block a user