I have a log4j properties in Config.groovy.
log4j = {
grails.serverURL = "http://localhost:8080/${appName}"
def catalinaBase = System.properties.getProperty('catalina.base')
if (!catalinaBase) catalinaBase = '.' // just in case
def logDirectory = "${catalinaBase}/logs"
appenders {
appender new org.apache.log4j.DailyRollingFileAppender(name: "friendsJob", datePattern: "'.'yyyy-MM-dd", file: "${logDirectory}/Sg/friends/friendsJob.txt", layout: pattern(conversionPattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %p %c{5} %m%n'))
appender new org.apache.log4j.DailyRollingFileAppender(name: "followerJob", datePattern: "'.'yyyy-MM-dd", file: "${logDirectory}/Sg/follower/followerJob.txt", layout: pattern(conversionPattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %p %c{5} %m%n'))
appender new org.apache.log4j.DailyRollingFileAppender(name: "mentionJob", datePattern: "'.'yyyy-MM-dd", file: "${logDirectory}/Sg/mention/mentionJob.txt", layout: pattern(conversionPattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %p %c{5} %m%n'))
appender new org.apache.log4j.DailyRollingFileAppender(name: "autoFollowJob", datePattern: "'.'yyyy-MM-dd", file: "${logDirectory}/Sg/autofollow/autoFollowJob.txt", layout: pattern(conversionPattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %p %c{5} %m%n'))
appender new org.apache.log4j.DailyRollingFileAppender(name: "retweetJob", datePattern: "'.'yyyy-MM-dd", file: "${logDirectory}/Sg/retweet/retweetJob.txt", layout: pattern(conversionPattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %p %c{5} %m%n'))
appender new org.apache.log4j.DailyRollingFileAppender(name: "profileUpdateJob", datePattern: "'.'yyyy-MM-dd", file: "${logDirectory}/Sg/profileUpdate/profileUpdateJob.txt", layout: pattern(conversionPattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %p %c{5} %m%n'))
appender new org.apache.log4j.DailyRollingFileAppender(name: "searchJob", datePattern: "'.'yyyy-MM-dd", file: "${logDirectory}/Sg/Search/searchJob.txt", layout: pattern(conversionPattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %p %c{5} %m%n'))
appender new org.apache.log4j.DailyRollingFileAppender(name: "appLog",datePattern: "'.'yyyy-MM-dd", file: "${logDirectory}/Sg/AppLog/appLog.log", layout: pattern(conversionPattern: '[%d{yyyy-MM-dd hh:mm:ss.SSS}] %p %c{5} %m%n'))
}
info friendsJob: 'grails.app.task.twitter.FriendsListJob'
info followerJob: 'grails.app.task.twitter.FollowersListJob'
info mentionJob: 'grails.app.task.twitter.MentionJob'
info autoFollowJob: 'grails.app.task.twitter.AutoFollowJob'
info retweetJob: 'grails.app.task.twitter.RetweetsJob'
info profileUpdateJob: 'grails.app.task.twitter.ProfileUpdateJob'
info searchJob: 'grails.app.task.twitter.SearchJob'
info appLog: 'grails.app.controller.SocialApiController'
info appLog: 'grails.app.service'
info appLog: 'grails.app.commons'
info appLog: 'grails.app.jsontwitter'
info appLog: 'grails.app.tagLib'
info appLog: 'grails.app.domain'
}
its work when i run the application from Intellij using Jetty. But when i create the war file and deploy to tomcat log files are created but no log generted.
Can some one help me. Where the log4j.properties file created in war. I also add my separate log4j.property file in /WEB-INF/lib/grails-core also. but of no use.