فهرست منبع

增加日志文件

lixing 3 سال پیش
والد
کامیت
d44dfc3ab3
2فایلهای تغییر یافته به همراه21 افزوده شده و 3 حذف شده
  1. 3 3
      src/main/resources/bootstrap.yml
  2. 18 0
      src/main/resources/log4j.properties

+ 3 - 3
src/main/resources/bootstrap.yml

@@ -2,8 +2,8 @@ spring:
   application:
     name: energy-report
 
-EUREKA_CLIENT_DEFAULT_ZONE: http://frame:123456@develop.persagy.com/integrated-eureka/eureka/
-#EUREKA_CLIENT_DEFAULT_ZONE: http://frame:123456@192.168.64.18:9931/eureka
-
+#EUREKA_CLIENT_DEFAULT_ZONE: http://frame:123456@develop.persagy.com/integrated-eureka/eureka/
+EUREKA_CLIENT_DEFAULT_ZONE: http://pbsage:123456@192.168.100.107:9931/eureka/
+CONFIG_SERVER_ID: poems-config
 
 

+ 18 - 0
src/main/resources/log4j.properties

@@ -0,0 +1,18 @@
+log4j.rootLogger=INFO,ConsoleAppender,RollingLogFileAppender
+
+#输出到文件
+log4j.appender.RollingLogFileAppender=org.apache.log4j.RollingFileAppender
+log4j.appender.RollingLogFileAppender.Threshold=INFO
+log4j.appender.RollingLogFileAppender.File=../logs/energy-report/log.log
+log4j.appender.RollingLogFileAppender.Append=true
+log4j.appender.RollingLogFileAppender.MaxFileSize=20MB
+log4j.appender.RollingLogFileAppender.MaxBackupIndex=100
+log4j.appender.RollingLogFileAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.RollingLogFileAppender.layout.ConversionPattern=%d{yyy MMM dd HH:mm:ss}:%-5p %l - %m%n
+#输出到控制台
+log4j.appender.ConsoleAppender=org.apache.log4j.ConsoleAppender
+log4j.appender.ConsoleAppender.Threshold=INFO
+log4j.appender.ConsoleAppender.ImmediateFlush=true
+log4j.appender.ConsoleAppender.Target=System.out
+log4j.appender.ConsoleAppender.layout=org.apache.log4j.PatternLayout
+log4j.appender.ConsoleAppender.layout.ConversionPattern=%d{yyyy-MM-dd HH\:mm\:ss}:%-5p %l - %m%n