New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Released
Owner: ----
Closed: Jul 2018



Sign in to add a comment
link

Issue 9345: Plugin's log file is not created when log4j.configuration environment variable is set

Reported by david.pu...@gmail.com, Jun 26 2018 Project Member

Issue description

*****************************************************************
*****                                                       *****
***** !!!! THIS BUG TRACKER IS FOR GERRIT CODE REVIEW !!!!  *****
*****                                                       *****
***** DO NOT SUBMIT BUGS FOR CHROME, ANDROID, CYANOGENMOD,  *****
***** INTERNAL ISSUES WITH YOUR COMPANY'S GERRIT SETUP, ETC.*****
*****                                                       *****
*****   THOSE ISSUES BELONG IN DIFFERENT ISSUE TRACKERS     *****
*****                                                       *****
*****************************************************************

Affected Version: 2.14.9

What steps will reproduce the problem?
1. Install a plugin that has a log file implemented via PluginLogFile, for example delete-projecoutt
2. Start gerrit with the VM option: -Dlog4j.configuration=file:////path/to/log4j.properties
3.

What is the expected output?

The plugin's log file is created at $site/logs/delete_log

What do you see instead?

A warning during startup:

  No appender with the name: delete_log was found. delete_log logging is disabled

and the log file is not created.

Please provide any additional information below.

I tried to configure the local log4j.properties file:

  # delete_log configuration (for delete-project plugin)
  log4j.logger.delete_log=INFO, delete_log
  log4j.appender.delete_log=org.apache.log4j.ConsoleAppender

but this results in an error that it can't find the 'layout' key for the delete_log appender.

Adding a layout key:

  log4j.appender.delete_log.layout=com.googlesource.gerrit.plugins.deleteproject.DeleteLogAppender

results in a class not found exception.
 

Comment 1 by david.pu...@gmail.com, Jun 26 2018

Status: ChangeUnderReview (was: New)
https://gerrit-review.googlesource.com/c/gerrit/+/186572

Comment 2 by thomasmu...@yahoo.com, Jun 26 2018

Project Member

Comment 3 by david.pu...@gmail.com, Jun 26 2018

We're not using xml config, but I did try to configure it as mentioned in the report.

It looks like your config is setting a layout. I wanted to make it use the layout class implemented in the plugin.

Comment 4 by david.pu...@gmail.com, Jul 3 2018

Labels: FixedIn-2.14.10
Status: Submitted (was: ChangeUnderReview)

Comment 5 by david.pu...@gmail.com, Jul 12 2018

Status: Released (was: Submitted)

Sign in to add a comment