-
Notifications
You must be signed in to change notification settings - Fork 951
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
logback.groovy configuration file not found with Logback 1.2.7 and Tomcat 9.0.43 in Grails 5.3.3 #13124
Comments
I made a small change to the application.yml configuration file logging:
config: grails-app/conf/logback.groovy
environments:
development:
dataSource:
dbCreate: create-drop
url: jdbc:h2:mem:devDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
test:
dataSource:
dbCreate: update
url: jdbc:h2:mem:testDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
production:
logging:
config: /usr/local/tomcat/webapps/ROOT/WEB-INF/classes/logback.groovy
dataSource:
dbCreate: none
url: jdbc:h2:./prodDb;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FALSE
properties:
jmxEnabled: true
initialSize: 5
maxActive: 50
minIdle: 5
maxIdle: 25
maxWait: 10000
maxAge: 600000
timeBetweenEvictionRunsMillis: 5000
minEvictableIdleTimeMillis: 60000
validationQuery: SELECT 1
validationQueryTimeout: 3
validationInterval: 15000
testOnBorrow: true
testWhileIdle: true
testOnReturn: false
jdbcInterceptors: ConnectionState
defaultTransactionIsolation: 2 # TRANSACTION_READ_COMMITTED It worked normally, if you want to see the project with Docker, follow the project link https://github.com/fernando88to/logback-tomcat The readme.md file contains instructions for running the project |
Thank you! I actually found this workaround myself, before publishing this bug report. But I think it's only a workaround, because in Grails 3 & 4 a reference to a local directories with logback 1.2.7 was not necessary. |
Expected Behavior
When the war is deployed/copied from the build directory of the project to the tomcat's deploy directory of the linux server (for example located at /var/lib/tomcat9/webapps/ROOT.war) the Grails application should start without throwing an exception and logging should work.
Note: This problem occurs only when deploying the app via a WAR file to a tomcat instance on a server. When running the WAR as standalone application the error does not occur.
Actual Behaviour
The Grails app can't find/locate logback.groovy and therefore throws a FileNotFoundException.
Steps To Reproduce
Unpack the Grails project attached [logback-tomcat.zip] (https://github.com/grails/grails-core/files/12585370/logback-tomcat.zip) by unzipping it
Change into the project directory
Build the war file with
Environment Information
Example Application
https://github.com/grails/grails-core/files/12585370/logback-tomcat.zip
Version
5.3.3
The text was updated successfully, but these errors were encountered: