I have set the logging level in the spring boot application in application.yml as: logging.level.com.Myapplicationname=DEBUG
The application is packaged and deployed as war on tomcat. Apart from this I haven't set the logback.xml to define the log file etc. Please tell me where can I see the console logs when some user uses the application over the browser. Is there any default file created by framework.
for those who are using spring boot 2.2.x you need to put this in configuration file
or use this
note that if you use logging.file.path it will writes spring.log to the specified directory. Names can be an exact location or relative to the current directory
You should either specify
logging.file
orlogging.path
, but not both ( when both are specified,logging.path
is ignored and onlylogging.file
is considered).1. Using logging.file
You may use
logging.file
one of the following way:In Spring Boot Documentation:
In Spring Boot's how to logging doc:
2. Using logging.path
You could also use
logging.path
to set the path, in which case the logfile will automatically be be namedspring.log
:In Spring Boot doc:
springframework.guru on Spring Boot logging:
As alexbt said, you cannot use both properties at the same time (logging.path and logging.file) because Spring Boot will ignore both.
But you can use logging.file with a path encoded.
Example: logging.file=/path/to/logs/your_logfile.log