tsgrp / OpenContent

TSG's Web Services for ECM Repositories
8 stars 4 forks source link

Default log4j.properties file eating logger.debug statements #39

Open mikeblum opened 10 years ago

mikeblum commented 10 years ago

The workaround for now is injecting a correct log4j.properties file in your respective overlay.

This is the original file found in vanilla alfresco WEB-INF/classes:

#set all classes to use the tsgConsole and only show FATAL or higher messages
log4j.rootLogger=FATAL, tsgConsole

LOG.PATH=.
LOG.PREFIX=oc-

PATTERN.FILE.FAST=%d{ISO8601}\t%r\t%t\t%-5p\t%c{1}\t%m%n

#TSG Console
log4j.appender.tsgConsole=org.apache.log4j.ConsoleAppender
log4j.appender.tsgConsole.Threshold=DEBUG
log4j.appender.tsgConsole.layout=org.apache.log4j.PatternLayout
log4j.appender.tsgConsole.layout.ConversionPattern=[%d{ISO8601}|%-5p|%c{1}|%M|%L] %m%n

#Logger for TSG code, allows our DEBUG messages or higher to show up
log4j.logger.com.tsgrp=DEBUG, tsgConsole,fileDebug,fileInfo,fileError
log4j.additivity.com.tsgrp=false

#DfcUtil is chatty... if you really want to know what it has to say, change this to debug
log4j.logger.com.tsgrp.util.dctm.DfcUtil=ERROR

log4j.logger.org.springframework.web=ERROR

log4j.appender.fileDebug=org.apache.log4j.DailyRollingFileAppender
log4j.appender.fileDebug.File=${LOG.PATH}/${LOG.PREFIX}debug.log
log4j.appender.fileDebug.DatePattern='.'yyyy-MM-dd
log4j.appender.fileDebug.Threshold=debug
log4j.appender.fileDebug.layout=org.apache.log4j.PatternLayout
log4j.appender.fileDebug.layout.ConversionPattern=${PATTERN.FILE.FAST}

log4j.appender.fileInfo=org.apache.log4j.DailyRollingFileAppender
log4j.appender.fileInfo.File=${LOG.PATH}/${LOG.PREFIX}info.log
log4j.appender.fileInfo.DatePattern='.'yyyy-MM-dd
log4j.appender.fileInfo.Threshold=info
log4j.appender.fileInfo.layout=org.apache.log4j.PatternLayout
log4j.appender.fileInfo.layout.ConversionPattern=${PATTERN.FILE.FAST}

log4j.appender.fileError=org.apache.log4j.DailyRollingFileAppender
log4j.appender.fileError.File=${LOG.PATH}/${LOG.PREFIX}error.log
log4j.appender.fileError.DatePattern='.'yyyy-MM-dd
log4j.appender.fileError.Threshold=error
log4j.appender.fileError.layout=org.apache.log4j.PatternLayout
log4j.appender.fileError.layout.ConversionPattern=${PATTERN.FILE.FAST}

This is the working file: (we should make this the default)

#this is a combination of oc's 1.core log4j and alfresco's default log4j. hopefully it overwrites the 1.core one!
#okay basically these two logging setups are like mutually exclusive we need to figure out
#how we want to have this set up in the long run

#set all classes to use the tsgConsole and only show FATAL or higher messages
log4j.rootLogger=error, Console, File

LOG.PATH=.
LOG.PREFIX=oc-

#PATTERN.FILE.FAST=%d{ISO8601}\t%r\t%t\t%-5p\t%c{1}\t%m%n
#
#TSG Console
#log4j.appender.tsgConsole=org.apache.log4j.ConsoleAppender
#log4j.appender.tsgConsole.Threshold=DEBUG
#log4j.appender.tsgConsole.layout=org.apache.log4j.PatternLayout
#log4j.appender.tsgConsole.layout.ConversionPattern=[%d{ISO8601}|%-5p|%c{1}|%M|%L] %m%n
#
#Logger for TSG code, allows our DEBUG messages or higher to show up
#log4j.logger.com.tsgrp=DEBUG, tsgConsole,fileDebug,fileInfo,fileError
#log4j.additivity.com.tsgrp=false
#
#log4j.appender.fileDebug=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.fileDebug.File=${LOG.PATH}/${LOG.PREFIX}debug.log
#log4j.appender.fileDebug.DatePattern='.'yyyy-MM-dd
#log4j.appender.fileDebug.Threshold=debug
#log4j.appender.fileDebug.layout=org.apache.log4j.PatternLayout
#log4j.appender.fileDebug.layout.ConversionPattern=${PATTERN.FILE.FAST}
#
#log4j.appender.fileInfo=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.fileInfo.File=${LOG.PATH}/${LOG.PREFIX}info.log
#log4j.appender.fileInfo.DatePattern='.'yyyy-MM-dd
#log4j.appender.fileInfo.Threshold=info
#log4j.appender.fileInfo.layout=org.apache.log4j.PatternLayout
#log4j.appender.fileInfo.layout.ConversionPattern=${PATTERN.FILE.FAST}
#
#log4j.appender.fileError=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.fileError.File=${LOG.PATH}/${LOG.PREFIX}error.log
#log4j.appender.fileError.DatePattern='.'yyyy-MM-dd
#log4j.appender.fileError.Threshold=error
#log4j.appender.fileError.layout=org.apache.log4j.PatternLayout
#log4j.appender.fileError.layout.ConversionPattern=${PATTERN.FILE.FAST}

###### Console appender definition #######

# All outputs currently set to be a ConsoleAppender.
log4j.appender.Console=org.apache.log4j.ConsoleAppender
log4j.appender.Console.layout=org.apache.log4j.PatternLayout

# use log4j NDC to replace %x with tenant domain / username
log4j.appender.Console.layout.ConversionPattern=%d{ISO8601} %x %-5p [%c{3}] [%t] %m%n
#log4j.appender.Console.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n

###### File appender definition #######
log4j.appender.File=org.apache.log4j.DailyRollingFileAppender
log4j.appender.File.File=alfresco.log
log4j.appender.File.Append=true
log4j.appender.File.DatePattern='.'yyyy-MM-dd
log4j.appender.File.layout=org.apache.log4j.PatternLayout
log4j.appender.File.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] %m%n

###### Hibernate specific appender definition #######
#log4j.appender.file=org.apache.log4j.FileAppender
#log4j.appender.file.File=hibernate.log
#log4j.appender.file.layout=org.apache.log4j.PatternLayout
#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n

###### Log level overrides #######

# Commented-in loggers will be exposed as JMX MBeans (refer to org.alfresco.repo.admin.Log4JHierarchyInit)
# Hence, generally useful loggers should be listed with at least ERROR level to allow simple runtime
# control of the level via a suitable JMX Console. Also, any other loggers can be added transiently via
# Log4j addLoggerMBean as long as the logger exists and has been loaded.

# Hibernate
log4j.logger.org.hibernate=error
log4j.logger.org.hibernate.util.JDBCExceptionReporter=fatal
log4j.logger.org.hibernate.event.def.AbstractFlushingEventListener=fatal
log4j.logger.org.hibernate.type=warn
log4j.logger.org.hibernate.cfg.SettingsFactory=warn

# Spring
log4j.logger.org.springframework=warn
# Turn off Spring remoting warnings that should really be info or debug.
log4j.logger.org.springframework.remoting.support=error
log4j.logger.org.springframework.util=error

# Axis/WSS4J
log4j.logger.org.apache.axis=info
log4j.logger.org.apache.ws=info

# CXF
log4j.logger.org.apache.cxf=error

# MyFaces
log4j.logger.org.apache.myfaces.util.DebugUtils=info
log4j.logger.org.apache.myfaces.el.VariableResolverImpl=error
log4j.logger.org.apache.myfaces.application.jsp.JspViewHandlerImpl=error
log4j.logger.org.apache.myfaces.taglib=error

# OpenOfficeConnection
log4j.logger.net.sf.jooreports.openoffice.connection=fatal

# log prepared statement cache activity ###
log4j.logger.org.hibernate.ps.PreparedStatementCache=info

# Alfresco
log4j.logger.org.alfresco=error
log4j.logger.org.alfresco.repo.admin=info
log4j.logger.org.alfresco.repo.cache.TransactionalCache=warn
log4j.logger.org.alfresco.repo.model.filefolder=warn
log4j.logger.org.alfresco.repo.tenant=info
log4j.logger.org.alfresco.repo.avm=info
log4j.logger.org.alfresco.config=warn
log4j.logger.org.alfresco.config.JndiObjectFactoryBean=warn
log4j.logger.org.alfresco.config.JBossEnabledWebApplicationContext=warn
log4j.logger.org.alfresco.repo.management.subsystems=warn
log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory=info
log4j.logger.org.alfresco.repo.management.subsystems.ChildApplicationContextFactory$ChildApplicationContext=warn
log4j.logger.org.alfresco.repo.security.sync=info
log4j.logger.org.alfresco.repo.security.person=info

log4j.logger.org.alfresco.repo.module=debug

log4j.logger.org.alfresco.sample=info
log4j.logger.org.alfresco.web=info
#log4j.logger.org.alfresco.web.app.AlfrescoNavigationHandler=debug
#log4j.logger.org.alfresco.web.ui.repo.component.UIActions=debug
#log4j.logger.org.alfresco.web.ui.repo.tag.PageTag=debug
#log4j.logger.org.alfresco.web.bean.clipboard=debug
log4j.logger.org.alfresco.repo.webservice=info
log4j.logger.org.alfresco.service.descriptor.DescriptorService=info
#log4j.logger.org.alfresco.web.page=debug

log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=error
#log4j.logger.org.alfresco.repo.importer.ImporterBootstrap=info

log4j.logger.org.alfresco.web.ui.common.Utils=error
#log4j.logger.org.alfresco.web.ui.common.Utils=info

log4j.logger.org.alfresco.repo.admin.patch.PatchExecuter=info
log4j.logger.org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl=info

# Specific patches
log4j.logger.org.alfresco.repo.admin.patch.impl.DeploymentMigrationPatch=info
log4j.logger.org.alfresco.repo.version.VersionMigrator=info
log4j.logger.org.alfresco.repo.admin.patch.impl.ResetWCMToGroupBasedPermissionsPatch=info

log4j.logger.org.alfresco.repo.module.ModuleServiceImpl=info
log4j.logger.org.alfresco.repo.domain.schema.SchemaBootstrap=info
log4j.logger.org.alfresco.repo.admin.ConfigurationChecker=info
log4j.logger.org.alfresco.repo.node.index.AbstractReindexComponent=warn
log4j.logger.org.alfresco.repo.node.index.IndexTransactionTracker=warn
log4j.logger.org.alfresco.repo.node.index.FullIndexRecoveryComponent=info
log4j.logger.org.alfresco.repo.node.index.AVMFullIndexRecoveryComponent=info
log4j.logger.org.alfresco.util.OpenOfficeConnectionTester=info
log4j.logger.org.alfresco.repo.node.db.hibernate.HibernateNodeDaoServiceImpl=warn
log4j.logger.org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor=warn
log4j.logger.org.alfresco.repo.transaction.RetryingTransactionHelper=warn
log4j.logger.org.alfresco.util.transaction.SpringAwareUserTransaction.trace=warn
log4j.logger.org.alfresco.util.AbstractTriggerBean=warn
log4j.logger.org.alfresco.repo.jgroups.AlfrescoJGroupsChannelFactory=info
log4j.logger.org.alfresco.enterprise.repo.cache.jgroups.JGroupsKeepAliveHeartbeatReceiver=info
log4j.logger.org.alfresco.repo.version.Version2ServiceImpl=warn

#log4j.logger.org.alfresco.web.app.DebugPhaseListener=debug
#log4j.logger.org.alfresco.repo.cache.EhCacheTracerJob=debug

log4j.logger.org.alfresco.repo.workflow=info

# CIFS server debugging
log4j.logger.org.alfresco.smb.protocol=error
#log4j.logger.org.alfresco.smb.protocol.auth=debug
#log4j.logger.org.alfresco.acegi=debug

# FTP server debugging
log4j.logger.org.alfresco.ftp.protocol=error
#log4j.logger.org.alfresco.ftp.server=debug

# WebDAV debugging
#log4j.logger.org.alfresco.webdav.protocol=debug
log4j.logger.org.alfresco.webdav.protocol=error

# NTLM servlet filters
#log4j.logger.org.alfresco.web.app.servlet.NTLMAuthenticationFilter=debug
#log4j.logger.org.alfresco.repo.webdav.auth.NTLMAuthenticationFilter=debug

# Kerberos servlet filters
#log4j.logger.org.alfresco.web.app.servlet.KerberosAuthenticationFilter=debug
#log4j.logger.org.alfresco.repo.webdav.auth.KerberosAuthenticationFilter=debug

# File servers
log4j.logger.org.alfresco.fileserver=warn

# Repo filesystem debug logging
#log4j.logger.org.alfresco.filesys.repo.ContentDiskDriver=debug

# AVM filesystem debug logging
#log4j.logger.org.alfresco.filesys.avm.AVMDiskDriver=debug

# Integrity message threshold - if 'failOnViolation' is off, then WARNINGS are generated
log4j.logger.org.alfresco.repo.node.integrity=ERROR

# Indexer debugging
log4j.logger.org.alfresco.repo.search.Indexer=error
#log4j.logger.org.alfresco.repo.search.Indexer=debug

log4j.logger.org.alfresco.repo.search.impl.lucene.index=error
log4j.logger.org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexerImpl=warn
#log4j.logger.org.alfresco.repo.search.impl.lucene.index=DEBUG

# Audit debugging
# log4j.logger.org.alfresco.repo.audit=DEBUG
# log4j.logger.org.alfresco.repo.audit.model=DEBUG

# Forms debugging
# log4j.logger.org.alfresco.web.forms=debug
# log4j.logger.org.chiba.xml.xforms=debug
log4j.logger.org.alfresco.web.forms.xforms.XFormsBean=error
log4j.logger.org.alfresco.web.forms.XSLTRenderingEngine=error

# Property sheet and modelling debugging
# change to error to hide the warnings about missing properties and associations
log4j.logger.alfresco.missingProperties=warn
log4j.logger.org.alfresco.web.ui.repo.component.property.UIChildAssociation=warn
log4j.logger.org.alfresco.web.ui.repo.component.property.UIAssociation=warn
#log4j.logger.org.alfresco.web.ui.repo.component.property=debug

# Dictionary/Model debugging
log4j.logger.org.alfresco.repo.dictionary=warn
log4j.logger.org.alfresco.repo.dictionary.types.period=warn

# Virtualization Server Registry
log4j.logger.org.alfresco.mbeans.VirtServerRegistry=error

# Spring context runtime property setter
log4j.logger.org.alfresco.util.RuntimeSystemPropertiesSetter=info

# Debugging options for clustering
log4j.logger.org.alfresco.repo.content.ReplicatingContentStore=error
log4j.logger.org.alfresco.repo.content.replication=error

#log4j.logger.org.alfresco.repo.deploy.DeploymentServiceImpl=debug

# Activity service
log4j.logger.org.alfresco.repo.activities=warn

# User usage tracking
log4j.logger.org.alfresco.repo.usage=info

# Sharepoint
log4j.logger.org.alfresco.module.vti=info

# Forms Engine
log4j.logger.org.alfresco.repo.forms=info
log4j.logger.org.alfresco.web.config.forms=info
log4j.logger.org.alfresco.web.scripts.forms=info

# CMIS
log4j.logger.org.alfresco.opencmis=error
log4j.logger.org.alfresco.opencmis.AlfrescoCmisServiceInterceptor=error
log4j.logger.org.alfresco.cmis=error
log4j.logger.org.alfresco.cmis.dictionary=warn
log4j.logger.org.apache.chemistry.opencmis=info

# IMAP
log4j.logger.org.alfresco.repo.imap=info

# JBPM
# Note: non-fatal errors (eg. logged during job execution) should be handled by Alfresco's retrying transaction handler
log4j.logger.org.jbpm.graph.def.GraphElement=fatal

#log4j.logger.org.alfresco.repo.googledocs=debug

###### Scripting #######

# Web Framework
log4j.logger.org.springframework.extensions.webscripts=info
log4j.logger.org.springframework.extensions.webscripts.ScriptLogger=warn
log4j.logger.org.springframework.extensions.webscripts.ScriptDebugger=off

# Repository
log4j.logger.org.alfresco.repo.web.scripts=warn
log4j.logger.org.alfresco.repo.web.scripts.BaseWebScriptTest=info
log4j.logger.org.alfresco.repo.web.scripts.AlfrescoRhinoScriptDebugger=off
log4j.logger.org.alfresco.repo.jscript=error
log4j.logger.org.alfresco.repo.jscript.ScriptLogger=warn
log4j.logger.org.alfresco.repo.cmis.rest.CMISTest=info

log4j.logger.org.alfresco.repo.avm.actions=info

# Freemarker
# Note the freemarker.runtime logger is used to log non-fatal errors that are handled by Alfresco's retrying transaction handler
log4j.logger.freemarker.runtime=

# Metadata extraction
log4j.logger.org.alfresco.repo.content.metadata.AbstractMappingMetadataExtracter=warn

# Reduces PDFont error level due to ALF-7105
log4j.logger.org.apache.pdfbox.pdmodel.font.PDSimpleFont=fatal
log4j.logger.org.apache.pdfbox.pdmodel.font.PDFont=fatal
log4j.logger.org.apache.pdfbox.pdmodel.font.PDCIDFont=fatal

# no index support
log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexIndexer=fatal
log4j.logger.org.alfresco.repo.search.impl.noindex.NoIndexSearchService=fatal

log4j.logger.org.activiti.engine=warn
benallenallen commented 10 years ago

The proper fix for this is to NOT copy over the log4j.properties file at all for Alfresco builds. The only log4j.properties file that should be copied over for the buildAmp and installDevelopmentAmp is the one located in \classes\alfresco\module\com.tsgrp.opencontent\log4j.properties.

Should just be a small update to the gradle build to ignore the log4j.properties file when building...

benallenallen commented 10 years ago

Duplicate of #18