logback中用日期/时间作为文件夹/目录/文件名
http://stackoverflow.com/questions/16278720/logback-create-log-files-inside-folder-having-name-as-current-date
As mentioned in the documentation for fileNamePattern, you can specify multiple %d tokens so as put the date in the folder name of the archive filename:
<fileNamePattern>${PROJECT_HOME}\\projectname\\audits\\%d{yyyy-MM, aux}\\myproject_%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
Note that only one %d token can be primary, all other tokens must be marked as auxiliary by passing the 'aux' parameter.
But if you also want to put it in the file name of the non-arhcive filename, then you have two options:
1. use a <timestamp /> element to set a variable which you use in the path. But this timestamp will only be set once at startup, so it's good for batch runs but not for services.
2. Do like (1) above, but wrap the <appender/> and the <timestamp /> with a SiftingAppender, which will enable the timestamp to be re-evaluated, if using version of logback >=1.0.12. Not sure exactly how you'd want to configure the SiftingAppender. But hopefully that will put you on the right track.
分享到:
相关推荐
logback与spring集成的文件...https://github.com/qos-ch/logback-extensions/tree/master/spring/src/main/java/ch/qos/logback/ext/spring/web 你也可以自己用maven去下载。 注意:此jar包支持spring3.1.1之后的版本
你可以访问:http://localhost:8080/try2Logback/crud2/login.jsp去访问,在Action中,去根据用户生成用户相关的信息。每个用户都有自己的文件夹。在Tomcat的webapps/Mylog文件夹下。 注意:<immediateFlush>false</...
spring使用logback的扩展,使用起来非常方便。在web.xml中配置: <param-name>logbackConfigLocation</param-name> <param-value>/WEB-INF/conf/logback.xml</param-value> </context-param> ...
logback-core-1.2.9.jar
该配置使日志先按日期进行归类,然后按大小输出异步日志
该压缩包包含 logback类库所包含的jar包以及logback.xml配置文件(放到 src 目录),用于开发学习使用。
logback-demos.rar http://blog.csdn.net/teaey/article/details/11920467
Slf4j+logback实现logback测试,Slf4j+logback实现logback测试
spring boot logback demo 源码可见:https://github.com/kent124454731/spring-boot-logback。 logback的一些说明可参见文章:http://blog.csdn.net/u011794238/article/details/50770557 如有乱码问题可参见:...
在application.propertiesa或yml中添加自定义logback的设置 logging.config=classpath:config/logback-spring.xml,把config文件夹复制到resource下即可,logback-spring.xml不需要修改,路径和日志大小格式等配置在...
内置三个jar包 一个配置文件 logback.txt logback-classic-1.2.3.jar logback-core-1.2.3.jar slf4j-api-1.7.26.jar
此zip包含logback-access-1.2.3和logback-classic-1.2.3和logback-core-1.2.3
赠送jar包:logback-core-1.2.10.jar; 赠送原API文档:logback-core-1.2.10-javadoc.jar; 赠送源代码:logback-core-1.2.10-sources.jar; 赠送Maven依赖信息文件:logback-core-1.2.10.pom; 包含翻译后的API文档...
具体就不多说了,案例里面有文档,而且每个注释都很详细
主要给大家介绍了关于Spring如何动态自定义logback日志目录的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
日志组件logback jar包,logback-access-1.1.3.jar logback-classic-1.1.3.jar logback-core-1.1.3.jar slf4j-api-1.7.12.jar
logback当前分成三个模块:logback-core,logback- classic和logback-access。logback-core是其它两个模块的基础模块。logback-classic是log4j的一个 改良版本。此外logback-classic完整实现SLF4J API使你可以很方便...
ryan.kong(Kong政)日期:2015-09-24目录说明使用1、说明本插件用于在运行时调整Logback日志级别2、使用在项目中引入Logback-log-level-control.jar包即可,不需要额外的配置2.1、接口说明rootpath/logback 获取所有...
INFLUXDB-LOGBACK 用于 Logback 的 InfluxDB Appender 使用此 appender 将带有 logback 的消息记录到 influxdb 服务器。 如果您不知道是什么,请跳上潮流! 安装 只需将 logback-gelf 添加到您的类路径中。 或者...
Logback中文文档 实用 api 带目录 覆盖内容全,深入学习logback首选