1

I have a logback-spring.xml in my resources folder together with my application.yml

i added the code below on my application.yml

logging:
    config: logback-spring.xml    

contents of logback-spring.xml was based on here

it does not create the log with the filename I indicated below

<file>/var/log/mylog.log</file>    
...   
<fileNamePattern>/var/log/mylog.%d{yyyy-MM-dd-HH-mm}.log</fileNamePattern>

any idea how to get this working?

Community
  • 1
  • 1
Dee
  • 401
  • 3
  • 9
  • 22
  • you would not need classpath prefix as long you can put them in folders such as 'resources' (maven project ) – kuhajeyan Dec 05 '16 at 07:47
  • i've removed classpath prefix but still does not create the file that i needed, thanks anw – Dee Dec 05 '16 at 08:40

1 Answers1

0

it should be logging.file,

logging.file=/var/log/mylog.log

http://docs.spring.io/spring-boot/docs/current/reference/html/howto-logging.html#howto-configure-logback-for-logging-fileonly

kuhajeyan
  • 10,727
  • 10
  • 46
  • 71
  • i need a logging that allows a daily rollover implementation for archiving purposes that's why i needed the logback-spring.xml, **fileNamePattern** was set to `%d{yyyy-MM-dd-HH-mm}` for testing purposes only – Dee Dec 06 '16 at 01:41