New issue
Advanced search Search tips
Starred by 2 users

Issue metadata

Status: Released
Owner: ----
Closed: Jul 3



Sign in to add a comment

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

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

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.

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

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

Hmm did you set delete-project.log in log4j?

Like https://github.com/wikimedia/puppet/blob/production/modules/gerrit/templates/log4j.xml.erb#L50 ?
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. 

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

Sign in to add a comment