cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco Custom Logging

kavilash23
Champ on-the-rise
Champ on-the-rise
Hi Guys,

I have installed the latest version of the Bulk Import Tool (1.3.1) and need to create a separate log file for it.

I have created the following file in $ALFRESCO_HOME/tomcat/shared/classes/alfresco/extension/bulk-log4j.properties with the following lines but when the bulkImport.log is generated, all the alfresco packages are being logged instead of just the bulk import tool (org.alfresco.extension.bulkfilesystemimport)

Can someone please advice on how i can have only logs for org.alfresco.extension.bulkfilesystemimport package?

# Set root logger level to error

log4j.rootLogger=error, Console, bFile

###### 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

###### bFile appender definition #######

log4j.appender.bFile=org.apache.log4j.DailyRollingFileAppender

log4j.appender.bFile.File=bulkImport.log

log4j.appender.bFile.Append=true

log4j.appender.bFile.DatePattern='.'yyyy-MM-dd

log4j.appender.bFile.layout=org.apache.log4j.PatternLayout

log4j.appender.bFile.layout.ConversionPattern=%d{ABSOLUTE} %-5p [%c] [%t] %m%n


######## Bulk Import Tool ######

log4j.logger.org.alfresco.extension.bulkfilesystemimport=debug


3 REPLIES 3

mrogers
Star Contributor
Star Contributor
Its been a while since I read the log4j docs but

og4j.rootLogger=error, Console, bFile  means send all errors to Console and bFile

progdevtom
Champ in-the-making
Champ in-the-making
Hi Kavi,
did you solve your problem? I'm very curious to do a similar thing.

kavilash23
Champ on-the-rise
Champ on-the-rise
I created a file called bulk.log4.properties in $TOMCAT_HOME/shared/classes/alfresco/extension with the following content;

# Set root logger level to error
log4j.rootLogger=ERROR, Console

###### 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

#Bulk Import Tool
log4j.logger.org.alfresco.extension.bulkfilesystemimport=ERROR, BULKIMPORT
log4j.logger.org.alfresco=ERROR, FILE

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

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

Hope this helps Smiley Happy