Skip to content

Commit

Permalink
Cherry pick tracer log config(#115) (#128)
Browse files Browse the repository at this point in the history
* fix tracer log config
  • Loading branch information
QilongZhang authored and straybirdzls committed Nov 16, 2018
1 parent 6958ca8 commit e7844c7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 147 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofaboot-dependencies</artifactId>
<version>2.5.1</version>
<version>2.5.2</version>
</parent>

<artifactId>tracer-all-parent</artifactId>
Expand Down
8 changes: 0 additions & 8 deletions tracer-samples/tracer-sample-with-sofarpc/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>rpc-sofa-boot-starter</artifactId>
<version>5.4.0</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand All @@ -35,14 +34,7 @@
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>infra-sofa-boot-starter</artifactId>
<version>2.4.6</version>
</dependency>
<dependency>
<groupId>com.alipay.sofa</groupId>
<artifactId>sofa-rpc-all</artifactId>
<version>5.4.0</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
return;
}

// set loggingPath
String loggingPath = environment.getProperty("logging.path");
if (StringUtils.isNotBlank(loggingPath)) {
System.setProperty("logging.path", loggingPath);
}

// check spring.application.name
String applicationName = environment
.getProperty(SofaTracerConfiguration.TRACER_APPNAME_KEY);
Expand All @@ -58,12 +64,6 @@ public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
SofaTracerConfiguration.setProperty(SofaTracerConfiguration.TRACER_APPNAME_KEY,
applicationName);

// set loggingPath
String loggingPath = environment.getProperty("logging.path");
if (StringUtils.isNotBlank(loggingPath)) {
System.setProperty("logging.path", loggingPath);
}

SofaTracerProperties tempTarget = new SofaTracerProperties();
PropertiesConfigurationFactory<SofaTracerProperties> binder = new PropertiesConfigurationFactory<SofaTracerProperties>(
tempTarget);
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ com.alipay.sofa.tracer.tracerGlobalRollingPolicy='.'yyyy-MM-dd_HH
com.alipay.sofa.tracer.tracerGlobalLogReserveDay=1
com.alipay.sofa.tracer.statLogInterval=1
com.alipay.sofa.tracer.baggageMaxLength=1
logging.path=./logs

0 comments on commit e7844c7

Please sign in to comment.