色欲av一区久久精品_久久综合色综合色88_无码在线观看不卡_色黄视频网站_亚洲国产精品久久久久秋霞66

logback日志文件位置動(dòng)態(tài)指定

時(shí)間:2023-05-16

logback相關(guān)裝備,其間${LOG_HOME}表明為環(huán)境變量,在java發(fā)動(dòng)應(yīng)用程序時(shí),經(jīng)過java-DLOG_HOME=”途徑”來指定的,能夠動(dòng)態(tài)去設(shè)置它的地址。
xmlversion=”1.0″encoding=”UTF-8″?><configuration><propertyname=”logPath”value=”${LOG_HOME-/home}/logs”/><appendername=”consoleLog”class=”ch.qos.logback.core.ConsoleAppender”><layoutclass=”ch.qos.logback.classic.PatternLayout”><pattern>%d-%msg%npattern>layout>appender><appendername=”fileInfoLog”class=”ch.qos.logback.core.rolling.RollingFileAppender”><filterclass=”ch.qos.logback.classic.filter.LevelFilter”><level>ERRORlevel><onMatch>DENYonMatch><onMismatch>ACCEPTonMismatch>filter><encoder><pattern>%d{yyyy-MM-ddHH:mm:ss.SSS}%10logger[%thread]:%msg%npattern>encoder><rollingPolicyclass=”ch.qos.logback.core.rolling.TimeBasedRollingPolicy”><fileNamePattern>${logPath}/info.%d.logfileNamePattern><maxHistory>7maxHistory>rollingPolicy>appender><appendername=”fileErrorLog”class=”ch.qos.logback.core.rolling.RollingFileAppender”><filterclass=”ch.qos.logback.classic.filter.ThresholdFilter”><level>ERRORlevel>filter><encoder><pattern>%d{yyyy-MM-ddHH:mm:ss.SSS}%10logger[%thread]:%msg%npattern>encoder><rollingPolicyclass=”ch.qos.logback.core.rolling.TimeBasedRollingPolicy”><fileNamePattern>${logPath}/error.%d.logfileNamePattern><maxHistory>7maxHistory>rollingPolicy>appender><rootlevel=”info”><appender-refref=”consoleLog”/><appender-refref=”fileInfoLog”/><appender-refref=”fileErrorLog”/>root>configuration>java
上面代碼中${LOG_HOME-/home}/logs表明,如果沒有傳入環(huán)境變量LOG_HOME,然后就使用后面的/home途徑,對(duì)于windows體系來說,/home表明當(dāng)時(shí)jar包地點(diǎn)的盤符。
項(xiàng)目發(fā)動(dòng)
java-Dlogback_home=”c:\\logs”-jareureka.jar
這樣就把日志文件存儲(chǔ)到了C盤logs目錄了。
docker容器時(shí)指定
dockerrun-d-p7070:7070-m200M-eJAVA_OPTIONS=’-Dlogback_home=”/deployments/’eurekaserver

文章標(biāo)簽:

Copyright ? 2016 廣州思洋文化傳播有限公司,保留所有權(quán)利。 粵ICP備09033321號(hào)

與項(xiàng)目經(jīng)理交流
掃描二維碼
與項(xiàng)目經(jīng)理交流
掃描二維碼
與項(xiàng)目經(jīng)理交流
ciya68