repo_name
stringclasses 5
values | pr_number
int64 1.52k
15.5k
| pr_title
stringlengths 8
143
| pr_description
stringlengths 0
10.2k
| author
stringlengths 3
18
| date_created
unknown | date_merged
unknown | previous_commit
stringlengths 40
40
| pr_commit
stringlengths 40
40
| query
stringlengths 11
10.2k
| filepath
stringlengths 6
220
| before_content
stringlengths 0
597M
| after_content
stringlengths 0
597M
| label
int64 -1
1
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-configservice/src/main/resources/bootstrap.yml | eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
server:
peerEurekaNodesUpdateIntervalMs: 60000
enableSelfPreservation: false
client:
serviceUrl:
# This setting will be overridden by eureka.service.url setting from ApolloConfigDB.ServerConfig or System Property
# see com.ctrip.framework.apollo.biz.eureka.ApolloEurekaClientConfig
defaultZone: http://${eureka.instance.hostname}:8080/eureka/
healthcheck:
enabled: true
eurekaServiceUrlPollIntervalSeconds: 60
management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
| eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
server:
peerEurekaNodesUpdateIntervalMs: 60000
enableSelfPreservation: false
client:
serviceUrl:
# This setting will be overridden by eureka.service.url setting from ApolloConfigDB.ServerConfig or System Property
# see com.ctrip.framework.apollo.biz.eureka.ApolloEurekaClientConfig
defaultZone: http://${eureka.instance.hostname}:8080/eureka/
healthcheck:
enabled: true
eurekaServiceUrlPollIntervalSeconds: 60
management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest5.xml | <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="application" order="abc"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="application" order="abc"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-configservice/src/assembly/assembly-descriptor.xml | <assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-assembly</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!--scripts -->
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
<excludes>
<exclude>apollo-configservice.conf</exclude>
<exclude>application-github.properties</exclude>
</excludes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>apollo-configservice.conf</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>application-github.properties</include>
</includes>
</fileSet>
<!--artifact -->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-*.jar</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
</assembly>
| <assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-assembly</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!--scripts -->
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
<excludes>
<exclude>apollo-configservice.conf</exclude>
<exclude>application-github.properties</exclude>
</excludes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>apollo-configservice.conf</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>application-github.properties</include>
</includes>
</fileSet>
<!--artifact -->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-*.jar</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
</assembly>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest2.xml | <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="application"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="application"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigAnnotationTest6.xml | <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config/>
<bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigChangeListenerWithInterestedKeysBean"/>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config/>
<bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigChangeListenerWithInterestedKeysBean"/>
</beans>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-configservice/src/test/resources/logback-test.xml | <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %c - %m%n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.test" level="OFF" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
| <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %c - %m%n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.test" level="OFF" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-buildtools/style/intellij-java-google-style.xml | <?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="GoogleStyle">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</value>
</option>
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="true" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
</value>
</option>
<option name="RIGHT_MARGIN" value="100" />
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
<option name="JD_P_AT_EMPTY_LINES" value="false" />
<option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
<option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
<option name="JD_KEEP_EMPTY_RETURN" value="false" />
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="0" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="WRAP_COMMENTS" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<AndroidXmlCodeStyleSettings>
<option name="USE_CUSTOM_SETTINGS" value="true" />
<option name="LAYOUT_SETTINGS">
<value>
<option name="INSERT_BLANK_LINE_BEFORE_TAG" value="false" />
</value>
</option>
</AndroidXmlCodeStyleSettings>
<JSCodeStyleSettings>
<option name="INDENT_CHAINED_CALLS" value="false" />
</JSCodeStyleSettings>
<Python>
<option name="USE_CONTINUATION_INDENT_FOR_ARGUMENTS" value="true" />
</Python>
<TypeScriptCodeStyleSettings>
<option name="INDENT_CHAINED_CALLS" value="false" />
</TypeScriptCodeStyleSettings>
<XML>
<option name="XML_ALIGN_ATTRIBUTES" value="false" />
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CSS">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="ECMA Script Level 4">
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_RESOURCES" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="WRAP_COMMENTS" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JSON">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="RIGHT_MARGIN" value="80" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="PROTO">
<option name="RIGHT_MARGIN" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="protobuf">
<option name="RIGHT_MARGIN" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Python">
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="RIGHT_MARGIN" value="80" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="SASS">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="SCSS">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:.*Style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_width</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_height</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_weight</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_margin</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginTop</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginBottom</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginStart</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginEnd</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginLeft</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginRight</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:padding</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingTop</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingBottom</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingStart</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingEnd</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingLeft</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingRight</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res-auto</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>http://schemas.android.com/tools</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<Objective-C>
<option name="INDENT_NAMESPACE_MEMBERS" value="0" />
<option name="INDENT_C_STRUCT_MEMBERS" value="2" />
<option name="INDENT_CLASS_MEMBERS" value="2" />
<option name="INDENT_VISIBILITY_KEYWORDS" value="1" />
<option name="INDENT_INSIDE_CODE_BLOCK" value="2" />
<option name="KEEP_STRUCTURES_IN_ONE_LINE" value="true" />
<option name="FUNCTION_PARAMETERS_WRAP" value="5" />
<option name="FUNCTION_CALL_ARGUMENTS_WRAP" value="5" />
<option name="TEMPLATE_CALL_ARGUMENTS_WRAP" value="5" />
<option name="TEMPLATE_CALL_ARGUMENTS_ALIGN_MULTILINE" value="true" />
<option name="ALIGN_INIT_LIST_IN_COLUMNS" value="false" />
<option name="SPACE_BEFORE_SUPERCLASS_COLON" value="false" />
</Objective-C>
<Objective-C-extensions>
<option name="GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES" value="ASK" />
<option name="RELEASE_STYLE" value="IVAR" />
<option name="TYPE_QUALIFIERS_PLACEMENT" value="BEFORE" />
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cc" header="h" />
<pair source="c" header="h" />
</extensions>
</Objective-C-extensions>
<codeStyleSettings language="ObjectiveC">
<option name="RIGHT_MARGIN" value="80" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
<option name="BLANK_LINES_BEFORE_IMPORTS" value="0" />
<option name="BLANK_LINES_AFTER_IMPORTS" value="0" />
<option name="BLANK_LINES_AROUND_CLASS" value="0" />
<option name="BLANK_LINES_AROUND_METHOD" value="0" />
<option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="false" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
| <?xml version="1.0" encoding="UTF-8"?>
<code_scheme name="GoogleStyle">
<option name="OTHER_INDENT_OPTIONS">
<value>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
<option name="USE_TAB_CHARACTER" value="false" />
<option name="SMART_TABS" value="false" />
<option name="LABEL_INDENT_SIZE" value="0" />
<option name="LABEL_INDENT_ABSOLUTE" value="false" />
<option name="USE_RELATIVE_INDENTS" value="false" />
</value>
</option>
<option name="INSERT_INNER_CLASS_IMPORTS" value="true" />
<option name="CLASS_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="NAMES_COUNT_TO_USE_IMPORT_ON_DEMAND" value="999" />
<option name="PACKAGES_TO_USE_IMPORT_ON_DEMAND">
<value />
</option>
<option name="IMPORT_LAYOUT_TABLE">
<value>
<package name="" withSubpackages="true" static="true" />
<emptyLine />
<package name="" withSubpackages="true" static="false" />
</value>
</option>
<option name="RIGHT_MARGIN" value="100" />
<option name="JD_ALIGN_PARAM_COMMENTS" value="false" />
<option name="JD_ALIGN_EXCEPTION_COMMENTS" value="false" />
<option name="JD_P_AT_EMPTY_LINES" value="false" />
<option name="JD_KEEP_EMPTY_PARAMETER" value="false" />
<option name="JD_KEEP_EMPTY_EXCEPTION" value="false" />
<option name="JD_KEEP_EMPTY_RETURN" value="false" />
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="0" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="0" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="WRAP_COMMENTS" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="SPACE_BEFORE_ARRAY_INITIALIZER_LBRACE" value="true" />
<AndroidXmlCodeStyleSettings>
<option name="USE_CUSTOM_SETTINGS" value="true" />
<option name="LAYOUT_SETTINGS">
<value>
<option name="INSERT_BLANK_LINE_BEFORE_TAG" value="false" />
</value>
</option>
</AndroidXmlCodeStyleSettings>
<JSCodeStyleSettings>
<option name="INDENT_CHAINED_CALLS" value="false" />
</JSCodeStyleSettings>
<Python>
<option name="USE_CONTINUATION_INDENT_FOR_ARGUMENTS" value="true" />
</Python>
<TypeScriptCodeStyleSettings>
<option name="INDENT_CHAINED_CALLS" value="false" />
</TypeScriptCodeStyleSettings>
<XML>
<option name="XML_ALIGN_ATTRIBUTES" value="false" />
<option name="XML_LEGACY_SETTINGS_IMPORTED" value="true" />
</XML>
<codeStyleSettings language="CSS">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="ECMA Script Level 4">
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
</codeStyleSettings>
<codeStyleSettings language="HTML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JAVA">
<option name="KEEP_CONTROL_STATEMENT_IN_ONE_LINE" value="false" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="BLANK_LINES_AFTER_CLASS_HEADER" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_RESOURCES" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="EXTENDS_LIST_WRAP" value="1" />
<option name="THROWS_KEYWORD_WRAP" value="1" />
<option name="METHOD_CALL_CHAIN_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="WRAP_COMMENTS" value="true" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JSON">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="JavaScript">
<option name="RIGHT_MARGIN" value="80" />
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="ALIGN_MULTILINE_FOR" value="false" />
<option name="CALL_PARAMETERS_WRAP" value="1" />
<option name="METHOD_PARAMETERS_WRAP" value="1" />
<option name="BINARY_OPERATION_WRAP" value="1" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="TERNARY_OPERATION_WRAP" value="1" />
<option name="TERNARY_OPERATION_SIGNS_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ARRAY_INITIALIZER_WRAP" value="1" />
<option name="IF_BRACE_FORCE" value="3" />
<option name="DOWHILE_BRACE_FORCE" value="3" />
<option name="WHILE_BRACE_FORCE" value="3" />
<option name="FOR_BRACE_FORCE" value="3" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="PROTO">
<option name="RIGHT_MARGIN" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="protobuf">
<option name="RIGHT_MARGIN" value="80" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="Python">
<option name="KEEP_BLANK_LINES_IN_CODE" value="1" />
<option name="RIGHT_MARGIN" value="80" />
<option name="ALIGN_MULTILINE_PARAMETERS" value="false" />
<option name="PARENT_SETTINGS_INSTALLED" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="SASS">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="SCSS">
<indentOptions>
<option name="CONTINUATION_INDENT_SIZE" value="4" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="TypeScript">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
<codeStyleSettings language="XML">
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
<arrangement>
<rules>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:android</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>xmlns:.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:id</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>^$</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:.*Style</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_width</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_height</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_weight</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_margin</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginTop</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginBottom</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginStart</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginEnd</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginLeft</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_marginRight</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:layout_.*</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:padding</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingTop</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingBottom</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingStart</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingEnd</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingLeft</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*:paddingRight</NAME>
<XML_ATTRIBUTE />
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res/android</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>http://schemas.android.com/apk/res-auto</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>http://schemas.android.com/tools</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
<section>
<rule>
<match>
<AND>
<NAME>.*</NAME>
<XML_NAMESPACE>.*</XML_NAMESPACE>
</AND>
</match>
<order>BY_NAME</order>
</rule>
</section>
</rules>
</arrangement>
</codeStyleSettings>
<Objective-C>
<option name="INDENT_NAMESPACE_MEMBERS" value="0" />
<option name="INDENT_C_STRUCT_MEMBERS" value="2" />
<option name="INDENT_CLASS_MEMBERS" value="2" />
<option name="INDENT_VISIBILITY_KEYWORDS" value="1" />
<option name="INDENT_INSIDE_CODE_BLOCK" value="2" />
<option name="KEEP_STRUCTURES_IN_ONE_LINE" value="true" />
<option name="FUNCTION_PARAMETERS_WRAP" value="5" />
<option name="FUNCTION_CALL_ARGUMENTS_WRAP" value="5" />
<option name="TEMPLATE_CALL_ARGUMENTS_WRAP" value="5" />
<option name="TEMPLATE_CALL_ARGUMENTS_ALIGN_MULTILINE" value="true" />
<option name="ALIGN_INIT_LIST_IN_COLUMNS" value="false" />
<option name="SPACE_BEFORE_SUPERCLASS_COLON" value="false" />
</Objective-C>
<Objective-C-extensions>
<option name="GENERATE_INSTANCE_VARIABLES_FOR_PROPERTIES" value="ASK" />
<option name="RELEASE_STYLE" value="IVAR" />
<option name="TYPE_QUALIFIERS_PLACEMENT" value="BEFORE" />
<file>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
</file>
<class>
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
<option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
</class>
<extensions>
<pair source="cc" header="h" />
<pair source="c" header="h" />
</extensions>
</Objective-C-extensions>
<codeStyleSettings language="ObjectiveC">
<option name="RIGHT_MARGIN" value="80" />
<option name="KEEP_BLANK_LINES_BEFORE_RBRACE" value="1" />
<option name="BLANK_LINES_BEFORE_IMPORTS" value="0" />
<option name="BLANK_LINES_AFTER_IMPORTS" value="0" />
<option name="BLANK_LINES_AROUND_CLASS" value="0" />
<option name="BLANK_LINES_AROUND_METHOD" value="0" />
<option name="BLANK_LINES_AROUND_METHOD_IN_INTERFACE" value="0" />
<option name="ALIGN_MULTILINE_BINARY_OPERATION" value="false" />
<option name="BINARY_OPERATION_SIGN_ON_NEXT_LINE" value="true" />
<option name="FOR_STATEMENT_WRAP" value="1" />
<option name="ASSIGNMENT_WRAP" value="1" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="4" />
</indentOptions>
</codeStyleSettings>
</code_scheme>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-biz/src/test/resources/logback-test.xml | <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %c - %m%n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.test" level="OFF" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
| <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %c - %m%n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.test" level="OFF" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigAnnotationTest2.xml | <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config/>
<bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigBean2"/>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config/>
<bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigBean2"/>
</beans>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/test/resources/logback-test.xml | <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %c - %m%n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.test" level="OFF" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
| <?xml version="1.0" encoding="UTF-8"?>
<configuration scan="true">
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<charset>utf-8</charset>
<Pattern>[%p] %c - %m%n</Pattern>
</encoder>
</appender>
<logger name="org.springframework.test" level="OFF" />
<root level="WARN">
<appender-ref ref="CONSOLE" />
</root>
</configuration>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/config.namespace.placeholder.xml | <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="${xxx.from.system.property}"/>
<apollo:config namespaces="${yyy.from.system.property}" order="10"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config namespaces="${xxx.from.system.property}"/>
<apollo:config namespaces="${yyy.from.system.property}" order="10"/>
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout:100}"/>
<property name="batch" value="${batch:200}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigPlaceholderTest7.xml | <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config />
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout}"/>
<property name="batch" value="${batch}"/>
</bean>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config />
<bean class="com.ctrip.framework.apollo.spring.XmlConfigPlaceholderTest.TestXmlBean">
<property name="timeout" value="${timeout}"/>
<property name="batch" value="${batch}"/>
</bean>
</beans>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-adminservice/src/assembly/assembly-descriptor.xml | <assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-assembly</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!--scripts -->
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
<excludes>
<exclude>apollo-adminservice.conf</exclude>
<exclude>application-github.properties</exclude>
</excludes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>apollo-adminservice.conf</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>application-github.properties</include>
</includes>
</fileSet>
<!--artifact -->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-*.jar</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
</assembly>
| <assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd">
<id>apollo-assembly</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<!--scripts -->
<fileSet>
<directory>src/main/scripts</directory>
<outputDirectory>scripts</outputDirectory>
<includes>
<include>*.sh</include>
</includes>
<fileMode>0755</fileMode>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>config</outputDirectory>
<excludes>
<exclude>apollo-adminservice.conf</exclude>
<exclude>application-github.properties</exclude>
</excludes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>src/main/config</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>apollo-adminservice.conf</include>
</includes>
<lineEnding>unix</lineEnding>
</fileSet>
<fileSet>
<directory>target/classes</directory>
<outputDirectory>/config</outputDirectory>
<includes>
<include>application-github.properties</include>
</includes>
</fileSet>
<!--artifact -->
<fileSet>
<directory>target</directory>
<outputDirectory>/</outputDirectory>
<includes>
<include>${project.artifactId}-*.jar</include>
</includes>
<fileMode>0755</fileMode>
</fileSet>
</fileSets>
</assembly>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/yaml/case7.yml | apollo.test.testBean:false
| apollo.test.testBean:false
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/apollo-on-kubernetes/apollo-portal-server/scripts/startup-kubernetes.sh | #!/bin/bash
SERVICE_NAME=apollo-portal
## Adjust log dir if necessary
LOG_DIR=/opt/logs/apollo-portal-server
## Adjust server port if necessary
SERVER_PORT=8070
# SERVER_URL="http://localhost:$SERVER_PORT"
SERVER_URL="http://${APOLLO_PORTAL_SERVICE_NAME}:${SERVER_PORT}"
## Adjust memory settings if necessary
#export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8"
## Only uncomment the following when you are using server jvm
#export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks"
########### The following is the same for configservice, adminservice, portal ###########
export JAVA_OPTS="$JAVA_OPTS -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+DisableExplicitGC -XX:+ScavengeBeforeFullGC -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
# Find Java
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
javaexe="$JAVA_HOME/bin/java"
elif type -p java > /dev/null 2>&1; then
javaexe=$(type -p java)
elif [[ -x "/usr/bin/java" ]]; then
javaexe="/usr/bin/java"
else
echo "Unable to find Java"
exit 1
fi
if [[ "$javaexe" ]]; then
version=$("$javaexe" -version 2>&1 | awk -F '"' '/version/ {print $2}')
version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}')
# now version is of format 009003 (9.3.x)
if [ $version -ge 011000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
elif [ $version -ge 010000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
elif [ $version -ge 009000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
else
JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails"
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M"
fi
fi
printf "$(date) ==== Starting ==== \n"
cd `dirname $0`/..
chmod 755 $SERVICE_NAME".jar"
./$SERVICE_NAME".jar" start
rc=$?;
if [[ $rc != 0 ]];
then
echo "$(date) Failed to start $SERVICE_NAME.jar, return code: $rc"
exit $rc;
fi
tail -f /dev/null
| #!/bin/bash
SERVICE_NAME=apollo-portal
## Adjust log dir if necessary
LOG_DIR=/opt/logs/apollo-portal-server
## Adjust server port if necessary
SERVER_PORT=8070
# SERVER_URL="http://localhost:$SERVER_PORT"
SERVER_URL="http://${APOLLO_PORTAL_SERVICE_NAME}:${SERVER_PORT}"
## Adjust memory settings if necessary
#export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8"
## Only uncomment the following when you are using server jvm
#export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks"
########### The following is the same for configservice, adminservice, portal ###########
export JAVA_OPTS="$JAVA_OPTS -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+DisableExplicitGC -XX:+ScavengeBeforeFullGC -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
# Find Java
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
javaexe="$JAVA_HOME/bin/java"
elif type -p java > /dev/null 2>&1; then
javaexe=$(type -p java)
elif [[ -x "/usr/bin/java" ]]; then
javaexe="/usr/bin/java"
else
echo "Unable to find Java"
exit 1
fi
if [[ "$javaexe" ]]; then
version=$("$javaexe" -version 2>&1 | awk -F '"' '/version/ {print $2}')
version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}')
# now version is of format 009003 (9.3.x)
if [ $version -ge 011000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
elif [ $version -ge 010000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
elif [ $version -ge 009000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
else
JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails"
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M"
fi
fi
printf "$(date) ==== Starting ==== \n"
cd `dirname $0`/..
chmod 755 $SERVICE_NAME".jar"
./$SERVICE_NAME".jar" start
rc=$?;
if [[ $rc != 0 ]];
then
echo "$(date) Failed to start $SERVICE_NAME.jar, return code: $rc"
exit $rc;
fi
tail -f /dev/null
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-adminservice/src/test/resources/bootstrap.yml | eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
client:
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:8090/eureka/
healthcheck:
enabled: true
management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
| eureka:
instance:
hostname: ${hostname:localhost}
preferIpAddress: true
status-page-url-path: /info
health-check-url-path: /health
client:
serviceUrl:
defaultZone: http://${eureka.instance.hostname}:8090/eureka/
healthcheck:
enabled: true
management:
health:
status:
order: DOWN, OUT_OF_SERVICE, UNKNOWN, UP
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/apollo-on-kubernetes/apollo-portal-server/apollo-portal.conf | MODE=service
PID_FOLDER=.
LOG_FOLDER=/opt/logs/apollo-portal-server
| MODE=service
PID_FOLDER=.
LOG_FOLDER=/opt/logs/apollo-portal-server
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-client</artifactId>
<name>Apollo Client</name>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencyManagement>
<dependencies>
<!-- Spring Boot 2 requires Java 8, so we need to manually stick to 1.5.x version in order to compile apollo-client against Java 7 -->
<!-- This is only for apollo-client compilation use, because optional Spring dependencies are not transitive -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.16.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- apollo -->
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-core</artifactId>
</dependency>
<!-- end of apollo -->
<!-- guice -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<!-- end of guice -->
<!-- log -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- yml processing -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<!-- end of yml processing -->
<!-- optional spring dependency -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<optional>true</optional>
</dependency>
<!-- optional spring boot dependency -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<optional>true</optional>
</dependency>
<!-- test -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
<!-- take over jcl -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<!-- end of test -->
</dependencies>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-client</artifactId>
<name>Apollo Client</name>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencyManagement>
<dependencies>
<!-- Spring Boot 2 requires Java 8, so we need to manually stick to 1.5.x version in order to compile apollo-client against Java 7 -->
<!-- This is only for apollo-client compilation use, because optional Spring dependencies are not transitive -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-dependencies</artifactId>
<version>1.5.16.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<!-- apollo -->
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-core</artifactId>
</dependency>
<!-- end of apollo -->
<!-- guice -->
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
</dependency>
<!-- end of guice -->
<!-- log -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<!-- yml processing -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<!-- end of yml processing -->
<!-- optional spring dependency -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<optional>true</optional>
</dependency>
<!-- optional spring boot dependency -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-autoconfigure</artifactId>
<optional>true</optional>
</dependency>
<!-- test -->
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<scope>test</scope>
</dependency>
<!-- take over jcl -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
<!-- end of test -->
</dependencies>
</project>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./scripts/apollo-on-kubernetes/apollo-admin-server/scripts/startup-kubernetes.sh | #!/bin/bash
SERVICE_NAME=apollo-adminservice
## Adjust log dir if necessary
LOG_DIR=/opt/logs/apollo-admin-server
## Adjust server port if necessary
SERVER_PORT=8090
# SERVER_URL="http://localhost:${SERVER_PORT}"
SERVER_URL="http://${APOLLO_ADMIN_SERVICE_NAME}:${SERVER_PORT}"
## Adjust memory settings if necessary
#export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8"
## Only uncomment the following when you are using server jvm
#export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks"
########### The following is the same for configservice, adminservice, portal ###########
export JAVA_OPTS="$JAVA_OPTS -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+DisableExplicitGC -XX:+ScavengeBeforeFullGC -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
# Find Java
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
javaexe="$JAVA_HOME/bin/java"
elif type -p java > /dev/null 2>&1; then
javaexe=$(type -p java)
elif [[ -x "/usr/bin/java" ]]; then
javaexe="/usr/bin/java"
else
echo "Unable to find Java"
exit 1
fi
if [[ "$javaexe" ]]; then
version=$("$javaexe" -version 2>&1 | awk -F '"' '/version/ {print $2}')
version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}')
# now version is of format 009003 (9.3.x)
if [ $version -ge 011000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
elif [ $version -ge 010000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
elif [ $version -ge 009000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
else
JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails"
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M"
fi
fi
printf "$(date) ==== Starting ==== \n"
cd `dirname $0`/..
chmod 755 $SERVICE_NAME".jar"
./$SERVICE_NAME".jar" start
rc=$?;
if [[ $rc != 0 ]];
then
echo "$(date) Failed to start $SERVICE_NAME.jar, return code: $rc"
exit $rc;
fi
tail -f /dev/null
| #!/bin/bash
SERVICE_NAME=apollo-adminservice
## Adjust log dir if necessary
LOG_DIR=/opt/logs/apollo-admin-server
## Adjust server port if necessary
SERVER_PORT=8090
# SERVER_URL="http://localhost:${SERVER_PORT}"
SERVER_URL="http://${APOLLO_ADMIN_SERVICE_NAME}:${SERVER_PORT}"
## Adjust memory settings if necessary
#export JAVA_OPTS="-Xms2560m -Xmx2560m -Xss256k -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:NewSize=1536m -XX:MaxNewSize=1536m -XX:SurvivorRatio=8"
## Only uncomment the following when you are using server jvm
#export JAVA_OPTS="$JAVA_OPTS -server -XX:-ReduceInitialCardMarks"
########### The following is the same for configservice, adminservice, portal ###########
export JAVA_OPTS="$JAVA_OPTS -XX:ParallelGCThreads=4 -XX:MaxTenuringThreshold=9 -XX:+DisableExplicitGC -XX:+ScavengeBeforeFullGC -XX:SoftRefLRUPolicyMSPerMB=0 -XX:+ExplicitGCInvokesConcurrent -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Duser.timezone=Asia/Shanghai -Dclient.encoding.override=UTF-8 -Dfile.encoding=UTF-8 -Djava.security.egd=file:/dev/./urandom"
export JAVA_OPTS="$JAVA_OPTS -Dserver.port=$SERVER_PORT -Dlogging.file=$LOG_DIR/$SERVICE_NAME.log -XX:HeapDumpPath=$LOG_DIR/HeapDumpOnOutOfMemoryError/"
# Find Java
if [[ -n "$JAVA_HOME" ]] && [[ -x "$JAVA_HOME/bin/java" ]]; then
javaexe="$JAVA_HOME/bin/java"
elif type -p java > /dev/null 2>&1; then
javaexe=$(type -p java)
elif [[ -x "/usr/bin/java" ]]; then
javaexe="/usr/bin/java"
else
echo "Unable to find Java"
exit 1
fi
if [[ "$javaexe" ]]; then
version=$("$javaexe" -version 2>&1 | awk -F '"' '/version/ {print $2}')
version=$(echo "$version" | awk -F. '{printf("%03d%03d",$1,$2);}')
# now version is of format 009003 (9.3.x)
if [ $version -ge 011000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
elif [ $version -ge 010000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
elif [ $version -ge 009000 ]; then
JAVA_OPTS="$JAVA_OPTS -Xlog:gc*:$LOG_DIR/gc.log:time,level,tags -Xlog:safepoint -Xlog:gc+heap=trace"
else
JAVA_OPTS="$JAVA_OPTS -XX:+UseParNewGC"
JAVA_OPTS="$JAVA_OPTS -Xloggc:$LOG_DIR/gc.log -XX:+PrintGCDetails"
JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:+UseCMSInitiatingOccupancyOnly -XX:CMSInitiatingOccupancyFraction=60 -XX:+CMSClassUnloadingEnabled -XX:+CMSParallelRemarkEnabled -XX:CMSFullGCsBeforeCompaction=9 -XX:+CMSClassUnloadingEnabled -XX:+PrintGCDateStamps -XX:+PrintGCApplicationConcurrentTime -XX:+PrintHeapAtGC -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=5 -XX:GCLogFileSize=5M"
fi
fi
printf "$(date) ==== Starting ==== \n"
cd `dirname $0`/..
chmod 755 $SERVICE_NAME".jar"
./$SERVICE_NAME".jar" start
rc=$?;
if [[ $rc != 0 ]];
then
echo "$(date) Failed to start $SERVICE_NAME.jar, return code: $rc"
exit $rc;
fi
tail -f /dev/null
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/test/resources/spring/XmlConfigAnnotationTest3.xml | <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config/>
<bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigChangeListenerBean1"/>
</beans>
| <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apollo="http://www.ctrip.com/schema/apollo"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.ctrip.com/schema/apollo http://www.ctrip.com/schema/apollo.xsd">
<apollo:config/>
<bean class="com.ctrip.framework.apollo.spring.XMLConfigAnnotationTest.TestApolloConfigChangeListenerBean1"/>
</beans>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-common/src/main/resources/datasource.xml | <!--
for ctrip datasource
-->
<Datasources>
<Datasource
name="${pro_titan_dbname}"
testWhileIdle="true"
testOnBorrow="true"
testOnReturn="false"
validationQuery="SELECT 1"
initSql="set names utf8mb4"
validationInterval="30000"
timeBetweenEvictionRunsMillis="5000"
maxActive="100"
minIdle="10"
maxWait="10000"
initialSize="10"
removeAbandonedTimeout="60"
removeAbandoned="true"
logAbandoned="false"
minEvictableIdleTimeMillis="30000"
option="sendStringParametersAsUnicode=false"
/>
</Datasources>
| <!--
for ctrip datasource
-->
<Datasources>
<Datasource
name="${pro_titan_dbname}"
testWhileIdle="true"
testOnBorrow="true"
testOnReturn="false"
validationQuery="SELECT 1"
initSql="set names utf8mb4"
validationInterval="30000"
timeBetweenEvictionRunsMillis="5000"
maxActive="100"
minIdle="10"
maxWait="10000"
initialSize="10"
removeAbandonedTimeout="60"
removeAbandoned="true"
logAbandoned="false"
minEvictableIdleTimeMillis="30000"
option="sendStringParametersAsUnicode=false"
/>
</Datasources>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-configservice/src/test/resources/application.yml | spring:
application:
name: apollo-configservice
server:
port: ${port:8080}
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/${ctrip.appid}/apollo-configservice.log
ctrip:
appid: 100003171 | spring:
application:
name: apollo-configservice
server:
port: ${port:8080}
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/${ctrip.appid}/apollo-configservice.log
ctrip:
appid: 100003171 | -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-openapi/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-openapi</artifactId>
<name>Apollo Open Api</name>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-openapi</artifactId>
<name>Apollo Open Api</name>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<exclusions>
<exclusion>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./.github/stale.yml | # Configuration for probot-stale - https://github.com/probot/stale
# General configuration
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- discussion
- enhancement
- feature
- feature request
- help wanted
- info
- need investigation
- tips
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: true
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
# Label to use when marking an issue as stale
staleLabel: stale
# Pull request specific configuration
pulls:
# Number of days of inactivity before a stale Issue or Pull Request is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 30
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This pull request has been automatically marked as stale because it has not had activity
in the last 90 days. It will be closed in 30 days if no further activity occurs. Please
feel free to give a status update now, ping for review, or re-open when it's ready.
Thank you for your contributions!
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This pull request has been automatically closed because it has not had
activity in the last 30 days. Please feel free to give a status update now, ping for review, or re-open when it's ready.
Thank you for your contributions!
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
# Issue specific configuration
issues:
# Number of days of inactivity before a stale Issue or Pull Request is closed.
daysUntilClose: 14
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had activity in the
last 90 days. It will be closed in 14 days unless it is tagged "help wanted" or other activity
occurs. Thank you for your contributions.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed because it has not had activity in the
last 14 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted".
Thank you for your contributions.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
| # Configuration for probot-stale - https://github.com/probot/stale
# General configuration
# Number of days of inactivity before an issue becomes stale
daysUntilStale: 60
# Issues with these labels will never be considered stale
exemptLabels:
- bug
- discussion
- enhancement
- feature
- feature request
- help wanted
- info
- need investigation
- tips
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: true
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: true
# Label to use when marking an issue as stale
staleLabel: stale
# Pull request specific configuration
pulls:
# Number of days of inactivity before a stale Issue or Pull Request is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 30
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This pull request has been automatically marked as stale because it has not had activity
in the last 90 days. It will be closed in 30 days if no further activity occurs. Please
feel free to give a status update now, ping for review, or re-open when it's ready.
Thank you for your contributions!
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This pull request has been automatically closed because it has not had
activity in the last 30 days. Please feel free to give a status update now, ping for review, or re-open when it's ready.
Thank you for your contributions!
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
# Issue specific configuration
issues:
# Number of days of inactivity before a stale Issue or Pull Request is closed.
daysUntilClose: 14
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had activity in the
last 90 days. It will be closed in 14 days unless it is tagged "help wanted" or other activity
occurs. Thank you for your contributions.
# Comment to post when closing a stale Issue or Pull Request.
closeComment: >
This issue has been automatically closed because it has not had activity in the
last 14 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted".
Thank you for your contributions.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 1
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-biz/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-biz</artifactId>
<name>Apollo Biz</name>
<packaging>jar</packaging>
<properties>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-common</artifactId>
</dependency>
<!-- eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-biz</artifactId>
<name>Apollo Biz</name>
<packaging>jar</packaging>
<properties>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-common</artifactId>
</dependency>
<!-- eureka -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>
<!-- end of eureka -->
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
</project>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-assembly/src/main/resources/application.yml | spring:
profiles:
active: ${apollo_profile}
logging:
file: /opt/logs/100003171/apollo-assembly.log
| spring:
profiles:
active: ${apollo_profile}
logging:
file: /opt/logs/100003171/apollo-assembly.log
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-demo/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-demo</artifactId>
<name>Apollo Demo</name>
<packaging>jar</packaging>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- for spring demo -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<!-- for spring boot demo -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- for refresh scope demo -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
<!-- take over jcl -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
</dependencies>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>${revision}</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-demo</artifactId>
<name>Apollo Demo</name>
<packaging>jar</packaging>
<properties>
<java.version>1.7</java.version>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>${project.version}</version>
</dependency>
<!-- for spring demo -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
</dependency>
<!-- for spring boot demo -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-log4j2</artifactId>
</dependency>
<!-- for refresh scope demo -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-context</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
<!-- take over jcl -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
</dependencies>
</project>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-buildtools/pom.xml | <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-buildtools</artifactId>
<name>Apollo BuildTools</name>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<resources>
<resource>
<directory>src/main/scripts</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
| <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>${revision}</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-buildtools</artifactId>
<name>Apollo BuildTools</name>
<build>
<plugins>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>2.6</version>
<executions>
<execution>
<id>copy-resources</id>
<phase>validate</phase>
<goals>
<goal>copy-resources</goal>
</goals>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<resources>
<resource>
<directory>src/main/scripts</directory>
</resource>
</resources>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/controller/SignInController.java | package com.ctrip.framework.apollo.portal.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author lepdou 2017-08-30
*/
@Controller
public class SignInController {
@GetMapping("/signin")
public String login(@RequestParam(value = "error", required = false) String error,
@RequestParam(value = "logout", required = false) String logout) {
return "login.html";
}
}
| package com.ctrip.framework.apollo.portal.controller;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
/**
* @author lepdou 2017-08-30
*/
@Controller
public class SignInController {
@GetMapping("/signin")
public String login(@RequestParam(value = "error", required = false) String error,
@RequestParam(value = "logout", required = false) String logout) {
return "login.html";
}
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-adminservice/src/main/java/com/ctrip/framework/apollo/adminservice/controller/ReleaseController.java | package com.ctrip.framework.apollo.adminservice.controller;
import com.ctrip.framework.apollo.biz.entity.Namespace;
import com.ctrip.framework.apollo.biz.entity.Release;
import com.ctrip.framework.apollo.biz.message.MessageSender;
import com.ctrip.framework.apollo.biz.message.Topics;
import com.ctrip.framework.apollo.biz.service.NamespaceBranchService;
import com.ctrip.framework.apollo.biz.service.NamespaceService;
import com.ctrip.framework.apollo.biz.service.ReleaseService;
import com.ctrip.framework.apollo.biz.utils.ReleaseMessageKeyGenerator;
import com.ctrip.framework.apollo.common.constants.NamespaceBranchStatus;
import com.ctrip.framework.apollo.common.dto.ItemChangeSets;
import com.ctrip.framework.apollo.common.dto.ReleaseDTO;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.google.common.base.Splitter;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@RestController
public class ReleaseController {
private static final Splitter RELEASES_SPLITTER = Splitter.on(",").omitEmptyStrings()
.trimResults();
private final ReleaseService releaseService;
private final NamespaceService namespaceService;
private final MessageSender messageSender;
private final NamespaceBranchService namespaceBranchService;
public ReleaseController(
final ReleaseService releaseService,
final NamespaceService namespaceService,
final MessageSender messageSender,
final NamespaceBranchService namespaceBranchService) {
this.releaseService = releaseService;
this.namespaceService = namespaceService;
this.messageSender = messageSender;
this.namespaceBranchService = namespaceBranchService;
}
@GetMapping("/releases/{releaseId}")
public ReleaseDTO get(@PathVariable("releaseId") long releaseId) {
Release release = releaseService.findOne(releaseId);
if (release == null) {
throw new NotFoundException(String.format("release not found for %s", releaseId));
}
return BeanUtils.transform(ReleaseDTO.class, release);
}
@GetMapping("/releases")
public List<ReleaseDTO> findReleaseByIds(@RequestParam("releaseIds") String releaseIds) {
Set<Long> releaseIdSet = RELEASES_SPLITTER.splitToList(releaseIds).stream().map(Long::parseLong)
.collect(Collectors.toSet());
List<Release> releases = releaseService.findByReleaseIds(releaseIdSet);
return BeanUtils.batchTransform(ReleaseDTO.class, releases);
}
@GetMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all")
public List<ReleaseDTO> findAllReleases(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
Pageable page) {
List<Release> releases = releaseService.findAllReleases(appId, clusterName, namespaceName, page);
return BeanUtils.batchTransform(ReleaseDTO.class, releases);
}
@GetMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active")
public List<ReleaseDTO> findActiveReleases(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
Pageable page) {
List<Release> releases = releaseService.findActiveReleases(appId, clusterName, namespaceName, page);
return BeanUtils.batchTransform(ReleaseDTO.class, releases);
}
@GetMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/latest")
public ReleaseDTO getLatest(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName) {
Release release = releaseService.findLatestActiveRelease(appId, clusterName, namespaceName);
return BeanUtils.transform(ReleaseDTO.class, release);
}
@Transactional
@PostMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases")
public ReleaseDTO publish(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
@RequestParam("name") String releaseName,
@RequestParam(name = "comment", required = false) String releaseComment,
@RequestParam("operator") String operator,
@RequestParam(name = "isEmergencyPublish", defaultValue = "false") boolean isEmergencyPublish) {
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException(String.format("Could not find namespace for %s %s %s", appId,
clusterName, namespaceName));
}
Release release = releaseService.publish(namespace, releaseName, releaseComment, operator, isEmergencyPublish);
//send release message
Namespace parentNamespace = namespaceService.findParentNamespace(namespace);
String messageCluster;
if (parentNamespace != null) {
messageCluster = parentNamespace.getClusterName();
} else {
messageCluster = clusterName;
}
messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, messageCluster, namespaceName),
Topics.APOLLO_RELEASE_TOPIC);
return BeanUtils.transform(ReleaseDTO.class, release);
}
/**
* merge branch items to master and publish master
*
* @return published result
*/
@Transactional
@PostMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/updateAndPublish")
public ReleaseDTO updateAndPublish(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
@RequestParam("releaseName") String releaseName,
@RequestParam("branchName") String branchName,
@RequestParam(value = "deleteBranch", defaultValue = "true") boolean deleteBranch,
@RequestParam(name = "releaseComment", required = false) String releaseComment,
@RequestParam(name = "isEmergencyPublish", defaultValue = "false") boolean isEmergencyPublish,
@RequestBody ItemChangeSets changeSets) {
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException(String.format("Could not find namespace for %s %s %s", appId,
clusterName, namespaceName));
}
Release release = releaseService.mergeBranchChangeSetsAndRelease(namespace, branchName, releaseName,
releaseComment, isEmergencyPublish, changeSets);
if (deleteBranch) {
namespaceBranchService.deleteBranch(appId, clusterName, namespaceName, branchName,
NamespaceBranchStatus.MERGED, changeSets.getDataChangeLastModifiedBy());
}
messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, clusterName, namespaceName),
Topics.APOLLO_RELEASE_TOPIC);
return BeanUtils.transform(ReleaseDTO.class, release);
}
@Transactional
@PutMapping("/releases/{releaseId}/rollback")
public void rollback(@PathVariable("releaseId") long releaseId,
@RequestParam(name="toReleaseId", defaultValue = "-1") long toReleaseId,
@RequestParam("operator") String operator) {
Release release;
if (toReleaseId > -1) {
release = releaseService.rollbackTo(releaseId, toReleaseId, operator);
} else {
release = releaseService.rollback(releaseId, operator);
}
String appId = release.getAppId();
String clusterName = release.getClusterName();
String namespaceName = release.getNamespaceName();
//send release message
messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, clusterName, namespaceName),
Topics.APOLLO_RELEASE_TOPIC);
}
@Transactional
@PostMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/gray-del-releases")
public ReleaseDTO publish(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
@RequestParam("operator") String operator,
@RequestParam("releaseName") String releaseName,
@RequestParam(name = "comment", required = false) String releaseComment,
@RequestParam(name = "isEmergencyPublish", defaultValue = "false") boolean isEmergencyPublish,
@RequestParam(name = "grayDelKeys") Set<String> grayDelKeys){
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException(String.format("Could not find namespace for %s %s %s", appId,
clusterName, namespaceName));
}
Release release = releaseService.grayDeletionPublish(namespace, releaseName, releaseComment, operator, isEmergencyPublish, grayDelKeys);
//send release message
Namespace parentNamespace = namespaceService.findParentNamespace(namespace);
String messageCluster;
if (parentNamespace != null) {
messageCluster = parentNamespace.getClusterName();
} else {
messageCluster = clusterName;
}
messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, messageCluster, namespaceName),
Topics.APOLLO_RELEASE_TOPIC);
return BeanUtils.transform(ReleaseDTO.class, release);
}
}
| package com.ctrip.framework.apollo.adminservice.controller;
import com.ctrip.framework.apollo.biz.entity.Namespace;
import com.ctrip.framework.apollo.biz.entity.Release;
import com.ctrip.framework.apollo.biz.message.MessageSender;
import com.ctrip.framework.apollo.biz.message.Topics;
import com.ctrip.framework.apollo.biz.service.NamespaceBranchService;
import com.ctrip.framework.apollo.biz.service.NamespaceService;
import com.ctrip.framework.apollo.biz.service.ReleaseService;
import com.ctrip.framework.apollo.biz.utils.ReleaseMessageKeyGenerator;
import com.ctrip.framework.apollo.common.constants.NamespaceBranchStatus;
import com.ctrip.framework.apollo.common.dto.ItemChangeSets;
import com.ctrip.framework.apollo.common.dto.ReleaseDTO;
import com.ctrip.framework.apollo.common.exception.NotFoundException;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.google.common.base.Splitter;
import org.springframework.data.domain.Pageable;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
@RestController
public class ReleaseController {
private static final Splitter RELEASES_SPLITTER = Splitter.on(",").omitEmptyStrings()
.trimResults();
private final ReleaseService releaseService;
private final NamespaceService namespaceService;
private final MessageSender messageSender;
private final NamespaceBranchService namespaceBranchService;
public ReleaseController(
final ReleaseService releaseService,
final NamespaceService namespaceService,
final MessageSender messageSender,
final NamespaceBranchService namespaceBranchService) {
this.releaseService = releaseService;
this.namespaceService = namespaceService;
this.messageSender = messageSender;
this.namespaceBranchService = namespaceBranchService;
}
@GetMapping("/releases/{releaseId}")
public ReleaseDTO get(@PathVariable("releaseId") long releaseId) {
Release release = releaseService.findOne(releaseId);
if (release == null) {
throw new NotFoundException(String.format("release not found for %s", releaseId));
}
return BeanUtils.transform(ReleaseDTO.class, release);
}
@GetMapping("/releases")
public List<ReleaseDTO> findReleaseByIds(@RequestParam("releaseIds") String releaseIds) {
Set<Long> releaseIdSet = RELEASES_SPLITTER.splitToList(releaseIds).stream().map(Long::parseLong)
.collect(Collectors.toSet());
List<Release> releases = releaseService.findByReleaseIds(releaseIdSet);
return BeanUtils.batchTransform(ReleaseDTO.class, releases);
}
@GetMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/all")
public List<ReleaseDTO> findAllReleases(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
Pageable page) {
List<Release> releases = releaseService.findAllReleases(appId, clusterName, namespaceName, page);
return BeanUtils.batchTransform(ReleaseDTO.class, releases);
}
@GetMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/active")
public List<ReleaseDTO> findActiveReleases(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
Pageable page) {
List<Release> releases = releaseService.findActiveReleases(appId, clusterName, namespaceName, page);
return BeanUtils.batchTransform(ReleaseDTO.class, releases);
}
@GetMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases/latest")
public ReleaseDTO getLatest(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName) {
Release release = releaseService.findLatestActiveRelease(appId, clusterName, namespaceName);
return BeanUtils.transform(ReleaseDTO.class, release);
}
@Transactional
@PostMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/releases")
public ReleaseDTO publish(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
@RequestParam("name") String releaseName,
@RequestParam(name = "comment", required = false) String releaseComment,
@RequestParam("operator") String operator,
@RequestParam(name = "isEmergencyPublish", defaultValue = "false") boolean isEmergencyPublish) {
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException(String.format("Could not find namespace for %s %s %s", appId,
clusterName, namespaceName));
}
Release release = releaseService.publish(namespace, releaseName, releaseComment, operator, isEmergencyPublish);
//send release message
Namespace parentNamespace = namespaceService.findParentNamespace(namespace);
String messageCluster;
if (parentNamespace != null) {
messageCluster = parentNamespace.getClusterName();
} else {
messageCluster = clusterName;
}
messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, messageCluster, namespaceName),
Topics.APOLLO_RELEASE_TOPIC);
return BeanUtils.transform(ReleaseDTO.class, release);
}
/**
* merge branch items to master and publish master
*
* @return published result
*/
@Transactional
@PostMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/updateAndPublish")
public ReleaseDTO updateAndPublish(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
@RequestParam("releaseName") String releaseName,
@RequestParam("branchName") String branchName,
@RequestParam(value = "deleteBranch", defaultValue = "true") boolean deleteBranch,
@RequestParam(name = "releaseComment", required = false) String releaseComment,
@RequestParam(name = "isEmergencyPublish", defaultValue = "false") boolean isEmergencyPublish,
@RequestBody ItemChangeSets changeSets) {
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException(String.format("Could not find namespace for %s %s %s", appId,
clusterName, namespaceName));
}
Release release = releaseService.mergeBranchChangeSetsAndRelease(namespace, branchName, releaseName,
releaseComment, isEmergencyPublish, changeSets);
if (deleteBranch) {
namespaceBranchService.deleteBranch(appId, clusterName, namespaceName, branchName,
NamespaceBranchStatus.MERGED, changeSets.getDataChangeLastModifiedBy());
}
messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, clusterName, namespaceName),
Topics.APOLLO_RELEASE_TOPIC);
return BeanUtils.transform(ReleaseDTO.class, release);
}
@Transactional
@PutMapping("/releases/{releaseId}/rollback")
public void rollback(@PathVariable("releaseId") long releaseId,
@RequestParam(name="toReleaseId", defaultValue = "-1") long toReleaseId,
@RequestParam("operator") String operator) {
Release release;
if (toReleaseId > -1) {
release = releaseService.rollbackTo(releaseId, toReleaseId, operator);
} else {
release = releaseService.rollback(releaseId, operator);
}
String appId = release.getAppId();
String clusterName = release.getClusterName();
String namespaceName = release.getNamespaceName();
//send release message
messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, clusterName, namespaceName),
Topics.APOLLO_RELEASE_TOPIC);
}
@Transactional
@PostMapping("/apps/{appId}/clusters/{clusterName}/namespaces/{namespaceName}/gray-del-releases")
public ReleaseDTO publish(@PathVariable("appId") String appId,
@PathVariable("clusterName") String clusterName,
@PathVariable("namespaceName") String namespaceName,
@RequestParam("operator") String operator,
@RequestParam("releaseName") String releaseName,
@RequestParam(name = "comment", required = false) String releaseComment,
@RequestParam(name = "isEmergencyPublish", defaultValue = "false") boolean isEmergencyPublish,
@RequestParam(name = "grayDelKeys") Set<String> grayDelKeys){
Namespace namespace = namespaceService.findOne(appId, clusterName, namespaceName);
if (namespace == null) {
throw new NotFoundException(String.format("Could not find namespace for %s %s %s", appId,
clusterName, namespaceName));
}
Release release = releaseService.grayDeletionPublish(namespace, releaseName, releaseComment, operator, isEmergencyPublish, grayDelKeys);
//send release message
Namespace parentNamespace = namespaceService.findParentNamespace(namespace);
String messageCluster;
if (parentNamespace != null) {
messageCluster = parentNamespace.getClusterName();
} else {
messageCluster = clusterName;
}
messageSender.sendMessage(ReleaseMessageKeyGenerator.generate(appId, messageCluster, namespaceName),
Topics.APOLLO_RELEASE_TOPIC);
return BeanUtils.transform(ReleaseDTO.class, release);
}
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/resources/static/views/component/namespace-panel-branch-tab.html | <section class="branch-panel-body" ng-if="namespace.initialized &&
(namespace.hasBranch && namespace.displayControl.currentOperateBranch != 'master')">
<!--main header-->
<header class="panel-heading">
<div class="row">
<div class="col-md-6 col-sm-6 header-namespace">
<b class="namespace-name" ng-bind="namespace.viewName"
data-tooltip="tooltip" data-placement="bottom" title="{{namespace.comment}}"></b>
<span class="label label-warning no-radius namespace-label"
ng-show="namespace.branch.itemModifiedCnt > 0">{{'Component.Namespace.Branch.IsChanged' | translate }}
<span class="badge label badge-white namespace-label"
ng-bind="namespace.branch.itemModifiedCnt"></span>
</span>
<span class="label label-primary no-radius namespace-label"
ng-show="namespace.branch.lockOwner">{{'Component.Namespace.Branch.ChangeUser' | translate }}:
<span ng-bind="namespace.branch.lockOwner"></span>
</span>
</div>
<div class="col-md-6 col-sm-6 text-right header-buttons">
<a type="button" class="btn btn-success btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.ContinueGrayscalePublish' | translate }}"
ng-show="(namespace.hasReleasePermission || namespace.hasModifyPermission)"
ng-click="publish(namespace.branch)">
{{'Component.Namespace.Branch.GrayscalePublish' | translate }}
</a>
<a type="button" class="btn btn-primary btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.MergeToMasterAndPublish' | translate }}"
ng-show="(namespace.hasReleasePermission || namespace.hasModifyPermission)"
ng-click="mergeAndPublish(namespace.branch)">
{{'Component.Namespace.Branch.AllPublish' | translate }}
</a>
<a type="button" class="btn btn-warning btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.DiscardGrayscaleVersion' | translate }}" ng-show="(namespace.hasReleasePermission
|| (!namespace.branch.latestRelease && namespace.hasModifyPermission))"
ng-click="preDeleteBranch(namespace.branch)">
{{'Component.Namespace.Branch.DiscardGrayscale' | translate }}
</a>
</div>
</div>
</header>
<div id="BODY{{namespace.branch.id}}"
ng-class="{'collapse in': showNamespaceBody, 'collapse' : !showNamespaceBody}">
<div class="J_namespace-release-tip well well-sm no-radius text-center" ng-show="namespace.isConfigHidden">
<span style="color: red">{{'Component.Namespace.Branch.NoPermissionTips' | translate }}</span>
</div>
<!--second header-->
<header class="panel-heading second-panel-heading" ng-show="!namespace.isConfigHidden">
<div class="row">
<div class="col-md-12 pull-left">
<ul class="nav nav-tabs">
<li role="presentation" ng-click="switchView(namespace.branch, 'table')"
ng-show="namespace.isPropertiesFormat">
<a ng-class="{node_active:namespace.branch.viewType == 'table'}">
<img src="img/table.png">
{{'Component.Namespace.Branch.Tab.Configuration' | translate }}
</a>
</li>
<li role="presentation" ng-click="switchView(namespace.branch, 'rule')">
<a ng-class="{node_active:namespace.branch.viewType == 'rule'}">
<img src="img/rule.png">
{{'Component.Namespace.Branch.Tab.GrayscaleRule' | translate }}
<span class="badge badge-grey"
ng-bind="namespace.branch.grayIps.length + namespace.branch.grayApps.length"></span>
</a>
</li>
<li role="presentation" ng-click="switchView(namespace.branch, 'instance')">
<a ng-class="{node_active:namespace.branch.viewType == 'instance'}">
<img src="img/machine.png">
{{'Component.Namespace.Branch.Tab.GrayscaleInstance' | translate }}
<span class="badge badge-grey"
ng-bind="namespace.branch.latestReleaseInstances.total"></span>
</a>
</li>
<li role="presentation" ng-click="switchView(namespace.branch, 'history')">
<a ng-class="{node_active:namespace.branch.viewType == 'history'}">
<img src="img/change.png">
{{'Component.Namespace.Branch.Tab.ChangeHistory' | translate }}
</a>
</li>
</ul>
</div>
</div>
</header>
<!--namespace body-->
<section ng-show="!namespace.isConfigHidden">
<!--items-->
<div class="namespace-view-table" ng-show="namespace.branch.viewType == 'table'">
<div class="panel panel-default" ng-if="namespace.hasBranch">
<div class="panel-heading">
{{'Component.Namespace.Branch.Body.Item' | translate }}
<button type="button" class="btn btn-primary btn-sm pull-right" style="margin-top: -4px;"
ng-show="namespace.hasModifyPermission" ng-click="createItem(namespace.branch)">
<img src="img/plus.png">
{{'Component.Namespace.Branch.Body.AddedItem' | translate }}
</button>
</div>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
{{'Component.Namespace.Branch.Body.PublishState' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.key';desc=!desc;">
{{'Component.Namespace.Branch.Body.ItemKey' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
{{'Component.Namespace.Branch.Body.ItemMasterValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.Body.ItemGrayscaleValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.Body.ItemComment' | translate }}
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedBy';desc=!desc;">
{{'Component.Namespace.Branch.Body.ItemLastModify' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
{{'Component.Namespace.Branch.Body.ItemLastModifyTime' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
{{'Component.Namespace.Branch.Body.ItemOperator' | translate }}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="config in namespace.branch.branchItems |orderBy:col:desc"
ng-if="config.item.key">
<td width="7%" class="text-center">
<span class="label label-warning no-radius cursor-pointer" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ClickToSeeItemValue' | translate }}"
ng-if="config.isModified || config.isDeleted"
ng-click="showText(config.oldValue)">{{'Component.Namespace.Branch.Body.ItemNoPublish' | translate }}</span>
<span class="label label-default-light no-radius" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ItemEffective' | translate }}"
ng-if="!config.isModified">{{'Component.Namespace.Branch.Body.ItemPublished' | translate }}</span>
</td>
<td width="15%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.item.key)">
<span ng-bind="config.item.key | limitTo: 250"></span>
<span ng-bind="config.item.key.length > 250 ? '...' :''"></span>
<span class="label label-danger" ng-if="config.isDeleted" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.DeletedItem' | translate }}">{{'Component.Namespace.Branch.Body.Delete' | translate }}</span>
<span class="label label-info" ng-if="!config.isDeleted && config.masterItemExists"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ChangedFromMaster' | translate }}">{{'Component.Namespace.Branch.Body.Modify' | translate }}</span>
<span class="label label-success"
ng-if="!config.isDeleted && !config.masterItemExists" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.AddedByGrayscale' | translate }}">{{'Component.Namespace.Branch.Body.Added' | translate }}</span>
</td>
<td width="20%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.masterReleaseValue)">
<span ng-bind="config.masterReleaseValue | limitTo: 250"></span>
<span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
</td>
<td width="20%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.item.value)">
<span ng-bind="config.item.value | limitTo: 250"></span>
<span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
</td>
<td width="10%" title="{{config.item.comment}}">
<span ng-bind="config.item.comment | limitTo: 250"></span>
<span ng-bind="config.item.comment.length > 250 ?'...' : ''"></span>
</td>
<td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
</td>
<td width="10%"
ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
</td>
<td width="9%" class="text-center">
<img src="img/edit.png" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.Op.Modify' | translate }}"
ng-if="!config.isDeleted" ng-click="editItem(namespace.branch, config.item)"
ng-show="namespace.hasModifyPermission">
<img style="margin-left: 5px;" src="img/cancel.png" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.Op.Delete' | translate }}"
ng-if="!config.isDeleted"
ng-click="preDeleteItem(namespace.branch, config.item)"
ng-show="namespace.hasModifyPermission">
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-default"
ng-if="namespace.branch.masterItems && namespace.branch.masterItems.length > 0">
<div class="panel-heading">
{{'Component.Namespace.MasterBranch.Body.Title' | translate }}
</div>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>{{'Component.Namespace.MasterBranch.Body.PublishState' | translate }}</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.key';desc=!desc;">
{{'Component.Namespace.MasterBranch.Body.ItemKey' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
{{'Component.Namespace.MasterBranch.Body.ItemValue' | translate }}
</th>
<th>
{{'Component.Namespace.MasterBranch.Body.ItemComment' | translate }}
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedBy';desc=!desc;">
{{'Component.Namespace.MasterBranch.Body.ItemLastModify' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
{{'Component.Namespace.MasterBranch.Body.ItemLastModifyTime' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
{{'Component.Namespace.MasterBranch.Body.ItemOperator' | translate }}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="config in namespace.branch.masterItems |orderBy:col:desc"
ng-if="config.item.key">
<td width="8%" class="text-center">
<span class="label label-warning no-radius cursor-pointer" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.MasterBranch.Body.ClickToSeeItemValue' | translate }}"
ng-if="config.isModified || config.isDeleted"
ng-click="showText(config.oldValue)">{{'Component.Namespace.MasterBranch.Body.ItemNoPublish' | translate }}</span>
<span class="label label-default-light no-radius" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.MasterBranch.Body.ItemEffective' | translate }}"
ng-if="!config.isModified">{{'Component.Namespace.MasterBranch.Body.ItemPublished' | translate }}</span>
</td>
<td width="15%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.item.key)">
<span ng-bind="config.item.key | limitTo: 250"></span>
<span ng-bind="config.item.key.length > 250 ? '...' :''"></span>
<span class="label label-success" ng-if="config.isModified && !config.oldValue"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.MasterBranch.Body.AddedItem' | translate }}">{{'Component.Namespace.Branch.Body.Added' | translate }}</span>
<span class="label label-info"
ng-if="config.isModified && config.oldValue && !config.isDeleted"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ModifiedItem' | translate }}">{{'Component.Namespace.Branch.Body.Modify' | translate }}</span>
<span class="label label-danger" ng-if="config.isDeleted" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.DeletedItem' | translate }}">{{'Component.Namespace.Branch.Body.Delete' | translate }}</span>
</td>
<td width="35%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.item.value)">
<span ng-bind="config.item.value | limitTo: 250"></span>
<span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
</td>
<td width="12%" title="{{config.item.comment}}">
<span ng-bind="config.item.comment | limitTo: 250"></span>
<span ng-bind="config.item.comment.length > 250 ?'...' : ''"></span>
</td>
<td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
</td>
<td width="15%"
ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
</td>
<td width="5%" class="text-center">
<img src="img/gray.png" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.MasterBranch.Body.ModifyItem' | translate }}"
ng-if="!config.isDeleted" ng-click="editItem(namespace.branch, config.item)"
ng-show="namespace.hasModifyPermission">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--gray rules-->
<div class="rules-manage-view row" ng-show="namespace.branch.viewType == 'rule'">
<div class="alert alert-warning no-radius"
ng-show="!namespace.hasModifyPermission && !namespace.hasReleasePermission">
<strong>Tips:</strong>
{{'Component.Namespace.Branch.GrayScaleRule.NoPermissionTips' | translate }}
</div>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>{{'Component.Namespace.Branch.GrayScaleRule.AppId' | translate }}</th>
<th>{{'Component.Namespace.Branch.GrayScaleRule.IpList' | translate }}</th>
<th>{{'Component.Namespace.Branch.GrayScaleRule.Operator' | translate }}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="ruleItem in namespace.branch.rules.ruleItems">
<td width="20%" ng-bind="ruleItem.clientAppId"></td>
<td width="70%" ng-show="!ruleItem.ApplyToAllInstances"
ng-bind="ruleItem.clientIpList.join(', ')"></td>
<td width="70%" ng-show="ruleItem.ApplyToAllInstances">
{{'Component.Namespace.Branch.GrayScaleRule.ApplyToAllInstances' | translate }}</td>
<td class="text-center" width="10%">
<img src="img/edit.png" class="i-20 hover" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.GrayScaleRule.Modify' | translate }}"
ng-show="namespace.hasModifyPermission || namespace.hasReleasePermission"
ng-click="editRuleItem(namespace.branch, ruleItem)">
<img src="img/cancel.png" class="i-20 hover" style="margin-left: 5px;"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.GrayScaleRule.Delete' | translate }}"
ng-show="namespace.hasModifyPermission || namespace.hasReleasePermission"
ng-click="deleteRuleItem(namespace.branch, ruleItem)">
</td>
</tr>
</tbody>
</table>
<button class="btn btn-primary" ng-if="namespace.hasModifyPermission || namespace.hasReleasePermission"
ng-show="(namespace.isPublic && !namespace.isLinkedNamespace) ||
((!namespace.isPublic || namespace.isLinkedNamespace)
&& (!namespace.branch.rules
|| !namespace.branch.rules.ruleItems
|| !namespace.branch.rules.ruleItems.length))"
ng-click="addRuleItem(namespace.branch)">{{'Component.Namespace.Branch.GrayScaleRule.AddNewRule' | translate }}
</button>
</div>
<!--instances -->
<div class="panel panel-default" ng-show="namespace.branch.viewType == 'instance'">
<div class="panel-heading text-right">
<button class="btn btn-default btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Instance.RefreshList' | translate }}"
ng-click="refreshInstancesInfo(namespace.branch)">
<img ng-src="{{ '/img/refresh.png' | prefixPath }}" />
</button>
</div>
<div class="panel-body">
<div class="panel-default" ng-if="namespace.branch.latestReleaseInstances.total > 0">
<div class="panel-heading">
<a target="_blank" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Instance.ItemToSee' | translate }}"
ng-href="{{ '/config/history.html' | prefixPath }}?#/appid={{appId}}&env={{env}}&clusterName={{namespace.baseInfo.clusterName}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{namespace.branch.latestRelease.id}}">
{{namespace.branch.latestRelease.name}}
</a>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<td>{{'Component.Namespace.Branch.Instance.InstanceAppId' | translate }}</td>
<td>{{'Component.Namespace.Branch.Instance.InstanceClusterName' | translate }}</td>
<td>{{'Component.Namespace.Branch.Instance.InstanceDataCenter' | translate }}</td>
<td>{{'Component.Namespace.Branch.Instance.InstanceIp' | translate }}</td>
<td>{{'Component.Namespace.Branch.Instance.InstanceGetItemTime' | translate }}</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="instance in namespace.branch.latestReleaseInstances.content">
<td width="20%" ng-bind="instance.appId"></td>
<td width="20%" ng-bind="instance.clusterName"></td>
<td width="20%" ng-bind="instance.dataCenter"></td>
<td width="20%" ng-bind="instance.ip"></td>
<td width="20%">{{instance.configs && instance.configs.length ?
(instance.configs[0].releaseDeliveryTime | date: 'yyyy-MM-dd HH:mm:ss') : ''}}
</td>
</tr>
</tbody>
</table>
<div class="row text-center"
ng-show="namespace.branch.latestReleaseInstances.content.length < namespace.branch.latestReleaseInstances.total">
<button class="btn btn-default"
ng-click="loadInstanceInfo(namespace.branch)">{{'Component.Namespace.Branch.Instance.LoadMore' | translate }}</button>
</div>
</div>
<div class="text-center" ng-if="namespace.branch.latestReleaseInstances.total == 0">
{{'Component.Namespace.Branch.Instance.NoInstance' | translate }}
</div>
</div>
</div>
<!--history view-->
<div class="J_historyview history-view" ng-show="namespace.branch.viewType == 'history'">
<div class="media" ng-show="namespace.branch.commits && namespace.branch.commits.length"
ng-repeat="commits in namespace.branch.commits">
<div class="media-body">
<div class="row">
<div class="col-md-6 col-sm-6 ">
<h3 class="media-heading" ng-bind="commits.dataChangeCreatedBy"></h3>
</div>
<div class="col-md-6 col-sm-6 text-right">
<h5 class="media-heading"
ng-bind="commits.dataChangeCreatedTime | date: 'yyyy-MM-dd HH:mm:ss'"></h5>
</div>
</div>
<!--properties format-->
<table class="table table-bordered table-striped text-center table-hover"
style="margin-top: 5px;" ng-if="namespace.isPropertiesFormat">
<thead>
<tr>
<th>
{{'Component.Namespace.Branch.History.ItemType' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemKey' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemOldValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemNewValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemComment' | translate }}
</th>
</tr>
</thead>
<tbody>
<!--兼容老数据,不显示item类型为空行和注释的item-->
<tr ng-repeat="item in commits.changeSets.createItems" ng-show="item.key">
<td width="6%">
{{'Component.Namespace.Branch.History.NewAdded' | translate }}
</td>
<td width="20%" title="{{item.key}}">
<span ng-bind="item.key | limitTo: 250"></span>
<span ng-bind="item.key.length > 250 ? '...' :''"></span>
</td>
<td width="28%">
</td>
<td width="28%" class="cursor-pointer" title="{{item.value}}"
ng-click="showText(item.value)">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.updateItems">
<td width="6%">
{{'Component.Namespace.Branch.History.Modified' | translate }}
</td>
<td width="20%" title="{{item.newItem.key}}">
<span ng-bind="item.newItem.key | limitTo: 250"></span>
<span ng-bind="item.newItem.key.length > 250 ? '...' :''"></span>
</td>
<td width="28%" class="cursor-pointer" title="{{item.oldItem.value}}"
ng-click="showText(item.oldItem.value)">
<span ng-bind="item.oldItem.value | limitTo: 250"></span>
<span ng-bind="item.oldItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="28%" class="cursor-pointer" title="{{item.newItem.value}}"
ng-click="showText(item.newItem.value)">
<span ng-bind="item.newItem.value | limitTo: 250"></span>
<span ng-bind="item.newItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="18%" title="{{item.newItem.comment}}">
<span ng-bind="item.newItem.comment | limitTo: 250"></span>
<span ng-bind="item.newItem.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.deleteItems"
ng-show="item.key || item.comment">
<td width="6%">
{{'Component.Namespace.Branch.History.Deleted' | translate }}
</td>
<td width="20%" title="{{item.key}}">
<span ng-bind="item.key | limitTo: 250"></span>
<span ng-bind="item.key.length > 250 ? '...' :''"></span>
</td>
<td width="28%" title="{{item.value}}">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="28%">
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
</tbody>
</table>
<!--not properties format-->
<div ng-if="!namespace.isPropertiesFormat">
<div ng-repeat="item in commits.changeSets.createItems">
<textarea class="form-control no-radius" rows="20" ng-disabled="true"
ng-bind="item.value">
</textarea>
</div>
<div ng-repeat="item in commits.changeSets.updateItems">
<textarea class="form-control no-radius" rows="20" ng-disabled="true"
ng-bind="item.newItem.value">
</textarea>
</div>
</div>
</div>
<hr>
</div>
<div class="text-center">
<button type="button" class="btn btn-default" ng-show="!namespace.branch.hasLoadAllCommit"
ng-click="loadCommitHistory(namespace.branch)">{{'Component.Namespace.Branch.History.LoadMore' | translate }}
<span class="glyphicon glyphicon-menu-down"></span></button>
</div>
<div class="empty-container text-center"
ng-show="!namespace.branch.commits || !namespace.branch.commits.length">
{{'Component.Namespace.Branch.History.NoHistory' | translate }}
</div>
</div>
</section>
</div>
</section> | <section class="branch-panel-body" ng-if="namespace.initialized &&
(namespace.hasBranch && namespace.displayControl.currentOperateBranch != 'master')">
<!--main header-->
<header class="panel-heading">
<div class="row">
<div class="col-md-6 col-sm-6 header-namespace">
<b class="namespace-name" ng-bind="namespace.viewName"
data-tooltip="tooltip" data-placement="bottom" title="{{namespace.comment}}"></b>
<span class="label label-warning no-radius namespace-label"
ng-show="namespace.branch.itemModifiedCnt > 0">{{'Component.Namespace.Branch.IsChanged' | translate }}
<span class="badge label badge-white namespace-label"
ng-bind="namespace.branch.itemModifiedCnt"></span>
</span>
<span class="label label-primary no-radius namespace-label"
ng-show="namespace.branch.lockOwner">{{'Component.Namespace.Branch.ChangeUser' | translate }}:
<span ng-bind="namespace.branch.lockOwner"></span>
</span>
</div>
<div class="col-md-6 col-sm-6 text-right header-buttons">
<a type="button" class="btn btn-success btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.ContinueGrayscalePublish' | translate }}"
ng-show="(namespace.hasReleasePermission || namespace.hasModifyPermission)"
ng-click="publish(namespace.branch)">
{{'Component.Namespace.Branch.GrayscalePublish' | translate }}
</a>
<a type="button" class="btn btn-primary btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.MergeToMasterAndPublish' | translate }}"
ng-show="(namespace.hasReleasePermission || namespace.hasModifyPermission)"
ng-click="mergeAndPublish(namespace.branch)">
{{'Component.Namespace.Branch.AllPublish' | translate }}
</a>
<a type="button" class="btn btn-warning btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.DiscardGrayscaleVersion' | translate }}" ng-show="(namespace.hasReleasePermission
|| (!namespace.branch.latestRelease && namespace.hasModifyPermission))"
ng-click="preDeleteBranch(namespace.branch)">
{{'Component.Namespace.Branch.DiscardGrayscale' | translate }}
</a>
</div>
</div>
</header>
<div id="BODY{{namespace.branch.id}}"
ng-class="{'collapse in': showNamespaceBody, 'collapse' : !showNamespaceBody}">
<div class="J_namespace-release-tip well well-sm no-radius text-center" ng-show="namespace.isConfigHidden">
<span style="color: red">{{'Component.Namespace.Branch.NoPermissionTips' | translate }}</span>
</div>
<!--second header-->
<header class="panel-heading second-panel-heading" ng-show="!namespace.isConfigHidden">
<div class="row">
<div class="col-md-12 pull-left">
<ul class="nav nav-tabs">
<li role="presentation" ng-click="switchView(namespace.branch, 'table')"
ng-show="namespace.isPropertiesFormat">
<a ng-class="{node_active:namespace.branch.viewType == 'table'}">
<img src="img/table.png">
{{'Component.Namespace.Branch.Tab.Configuration' | translate }}
</a>
</li>
<li role="presentation" ng-click="switchView(namespace.branch, 'rule')">
<a ng-class="{node_active:namespace.branch.viewType == 'rule'}">
<img src="img/rule.png">
{{'Component.Namespace.Branch.Tab.GrayscaleRule' | translate }}
<span class="badge badge-grey"
ng-bind="namespace.branch.grayIps.length + namespace.branch.grayApps.length"></span>
</a>
</li>
<li role="presentation" ng-click="switchView(namespace.branch, 'instance')">
<a ng-class="{node_active:namespace.branch.viewType == 'instance'}">
<img src="img/machine.png">
{{'Component.Namespace.Branch.Tab.GrayscaleInstance' | translate }}
<span class="badge badge-grey"
ng-bind="namespace.branch.latestReleaseInstances.total"></span>
</a>
</li>
<li role="presentation" ng-click="switchView(namespace.branch, 'history')">
<a ng-class="{node_active:namespace.branch.viewType == 'history'}">
<img src="img/change.png">
{{'Component.Namespace.Branch.Tab.ChangeHistory' | translate }}
</a>
</li>
</ul>
</div>
</div>
</header>
<!--namespace body-->
<section ng-show="!namespace.isConfigHidden">
<!--items-->
<div class="namespace-view-table" ng-show="namespace.branch.viewType == 'table'">
<div class="panel panel-default" ng-if="namespace.hasBranch">
<div class="panel-heading">
{{'Component.Namespace.Branch.Body.Item' | translate }}
<button type="button" class="btn btn-primary btn-sm pull-right" style="margin-top: -4px;"
ng-show="namespace.hasModifyPermission" ng-click="createItem(namespace.branch)">
<img src="img/plus.png">
{{'Component.Namespace.Branch.Body.AddedItem' | translate }}
</button>
</div>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
{{'Component.Namespace.Branch.Body.PublishState' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.key';desc=!desc;">
{{'Component.Namespace.Branch.Body.ItemKey' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
{{'Component.Namespace.Branch.Body.ItemMasterValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.Body.ItemGrayscaleValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.Body.ItemComment' | translate }}
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedBy';desc=!desc;">
{{'Component.Namespace.Branch.Body.ItemLastModify' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
{{'Component.Namespace.Branch.Body.ItemLastModifyTime' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
{{'Component.Namespace.Branch.Body.ItemOperator' | translate }}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="config in namespace.branch.branchItems |orderBy:col:desc"
ng-if="config.item.key">
<td width="7%" class="text-center">
<span class="label label-warning no-radius cursor-pointer" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ClickToSeeItemValue' | translate }}"
ng-if="config.isModified || config.isDeleted"
ng-click="showText(config.oldValue)">{{'Component.Namespace.Branch.Body.ItemNoPublish' | translate }}</span>
<span class="label label-default-light no-radius" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ItemEffective' | translate }}"
ng-if="!config.isModified">{{'Component.Namespace.Branch.Body.ItemPublished' | translate }}</span>
</td>
<td width="15%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.item.key)">
<span ng-bind="config.item.key | limitTo: 250"></span>
<span ng-bind="config.item.key.length > 250 ? '...' :''"></span>
<span class="label label-danger" ng-if="config.isDeleted" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.DeletedItem' | translate }}">{{'Component.Namespace.Branch.Body.Delete' | translate }}</span>
<span class="label label-info" ng-if="!config.isDeleted && config.masterItemExists"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ChangedFromMaster' | translate }}">{{'Component.Namespace.Branch.Body.Modify' | translate }}</span>
<span class="label label-success"
ng-if="!config.isDeleted && !config.masterItemExists" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.AddedByGrayscale' | translate }}">{{'Component.Namespace.Branch.Body.Added' | translate }}</span>
</td>
<td width="20%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.masterReleaseValue)">
<span ng-bind="config.masterReleaseValue | limitTo: 250"></span>
<span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
</td>
<td width="20%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.item.value)">
<span ng-bind="config.item.value | limitTo: 250"></span>
<span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
</td>
<td width="10%" title="{{config.item.comment}}">
<span ng-bind="config.item.comment | limitTo: 250"></span>
<span ng-bind="config.item.comment.length > 250 ?'...' : ''"></span>
</td>
<td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
</td>
<td width="10%"
ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
</td>
<td width="9%" class="text-center">
<img src="img/edit.png" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.Op.Modify' | translate }}"
ng-if="!config.isDeleted" ng-click="editItem(namespace.branch, config.item)"
ng-show="namespace.hasModifyPermission">
<img style="margin-left: 5px;" src="img/cancel.png" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.Op.Delete' | translate }}"
ng-if="!config.isDeleted"
ng-click="preDeleteItem(namespace.branch, config.item)"
ng-show="namespace.hasModifyPermission">
</td>
</tr>
</tbody>
</table>
</div>
<div class="panel panel-default"
ng-if="namespace.branch.masterItems && namespace.branch.masterItems.length > 0">
<div class="panel-heading">
{{'Component.Namespace.MasterBranch.Body.Title' | translate }}
</div>
<table class="table table-bordered table-striped table-hover">
<thead>
<tr>
<th>{{'Component.Namespace.MasterBranch.Body.PublishState' | translate }}</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.key';desc=!desc;">
{{'Component.Namespace.MasterBranch.Body.ItemKey' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
{{'Component.Namespace.MasterBranch.Body.ItemValue' | translate }}
</th>
<th>
{{'Component.Namespace.MasterBranch.Body.ItemComment' | translate }}
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedBy';desc=!desc;">
{{'Component.Namespace.MasterBranch.Body.ItemLastModify' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th class="hover" title="{{'Component.Namespace.Branch.Body.ItemSort' | translate }}"
ng-click="col='item.dataChangeLastModifiedTime';desc=!desc;">
{{'Component.Namespace.MasterBranch.Body.ItemLastModifyTime' | translate }}
<span class="glyphicon glyphicon-sort"></span>
</th>
<th>
{{'Component.Namespace.MasterBranch.Body.ItemOperator' | translate }}
</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="config in namespace.branch.masterItems |orderBy:col:desc"
ng-if="config.item.key">
<td width="8%" class="text-center">
<span class="label label-warning no-radius cursor-pointer" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.MasterBranch.Body.ClickToSeeItemValue' | translate }}"
ng-if="config.isModified || config.isDeleted"
ng-click="showText(config.oldValue)">{{'Component.Namespace.MasterBranch.Body.ItemNoPublish' | translate }}</span>
<span class="label label-default-light no-radius" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.MasterBranch.Body.ItemEffective' | translate }}"
ng-if="!config.isModified">{{'Component.Namespace.MasterBranch.Body.ItemPublished' | translate }}</span>
</td>
<td width="15%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.item.key)">
<span ng-bind="config.item.key | limitTo: 250"></span>
<span ng-bind="config.item.key.length > 250 ? '...' :''"></span>
<span class="label label-success" ng-if="config.isModified && !config.oldValue"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.MasterBranch.Body.AddedItem' | translate }}">{{'Component.Namespace.Branch.Body.Added' | translate }}</span>
<span class="label label-info"
ng-if="config.isModified && config.oldValue && !config.isDeleted"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.ModifiedItem' | translate }}">{{'Component.Namespace.Branch.Body.Modify' | translate }}</span>
<span class="label label-danger" ng-if="config.isDeleted" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.Body.DeletedItem' | translate }}">{{'Component.Namespace.Branch.Body.Delete' | translate }}</span>
</td>
<td width="35%" class="cursor-pointer"
title="{{'Component.Namespace.Branch.Body.ClickToSee' | translate }}"
ng-click="showText(config.item.value)">
<span ng-bind="config.item.value | limitTo: 250"></span>
<span ng-bind="config.item.value.length > 250 ? '...': ''"></span>
</td>
<td width="12%" title="{{config.item.comment}}">
<span ng-bind="config.item.comment | limitTo: 250"></span>
<span ng-bind="config.item.comment.length > 250 ?'...' : ''"></span>
</td>
<td width="10%" ng-bind="config.item.dataChangeLastModifiedBy">
</td>
<td width="15%"
ng-bind="config.item.dataChangeLastModifiedTime | date: 'yyyy-MM-dd HH:mm:ss'">
</td>
<td width="5%" class="text-center">
<img src="img/gray.png" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.MasterBranch.Body.ModifyItem' | translate }}"
ng-if="!config.isDeleted" ng-click="editItem(namespace.branch, config.item)"
ng-show="namespace.hasModifyPermission">
</td>
</tr>
</tbody>
</table>
</div>
</div>
<!--gray rules-->
<div class="rules-manage-view row" ng-show="namespace.branch.viewType == 'rule'">
<div class="alert alert-warning no-radius"
ng-show="!namespace.hasModifyPermission && !namespace.hasReleasePermission">
<strong>Tips:</strong>
{{'Component.Namespace.Branch.GrayScaleRule.NoPermissionTips' | translate }}
</div>
<table class="table table-bordered table-hover">
<thead>
<tr>
<th>{{'Component.Namespace.Branch.GrayScaleRule.AppId' | translate }}</th>
<th>{{'Component.Namespace.Branch.GrayScaleRule.IpList' | translate }}</th>
<th>{{'Component.Namespace.Branch.GrayScaleRule.Operator' | translate }}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="ruleItem in namespace.branch.rules.ruleItems">
<td width="20%" ng-bind="ruleItem.clientAppId"></td>
<td width="70%" ng-show="!ruleItem.ApplyToAllInstances"
ng-bind="ruleItem.clientIpList.join(', ')"></td>
<td width="70%" ng-show="ruleItem.ApplyToAllInstances">
{{'Component.Namespace.Branch.GrayScaleRule.ApplyToAllInstances' | translate }}</td>
<td class="text-center" width="10%">
<img src="img/edit.png" class="i-20 hover" data-tooltip="tooltip"
data-placement="bottom"
title="{{'Component.Namespace.Branch.GrayScaleRule.Modify' | translate }}"
ng-show="namespace.hasModifyPermission || namespace.hasReleasePermission"
ng-click="editRuleItem(namespace.branch, ruleItem)">
<img src="img/cancel.png" class="i-20 hover" style="margin-left: 5px;"
data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.GrayScaleRule.Delete' | translate }}"
ng-show="namespace.hasModifyPermission || namespace.hasReleasePermission"
ng-click="deleteRuleItem(namespace.branch, ruleItem)">
</td>
</tr>
</tbody>
</table>
<button class="btn btn-primary" ng-if="namespace.hasModifyPermission || namespace.hasReleasePermission"
ng-show="(namespace.isPublic && !namespace.isLinkedNamespace) ||
((!namespace.isPublic || namespace.isLinkedNamespace)
&& (!namespace.branch.rules
|| !namespace.branch.rules.ruleItems
|| !namespace.branch.rules.ruleItems.length))"
ng-click="addRuleItem(namespace.branch)">{{'Component.Namespace.Branch.GrayScaleRule.AddNewRule' | translate }}
</button>
</div>
<!--instances -->
<div class="panel panel-default" ng-show="namespace.branch.viewType == 'instance'">
<div class="panel-heading text-right">
<button class="btn btn-default btn-sm" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Instance.RefreshList' | translate }}"
ng-click="refreshInstancesInfo(namespace.branch)">
<img ng-src="{{ '/img/refresh.png' | prefixPath }}" />
</button>
</div>
<div class="panel-body">
<div class="panel-default" ng-if="namespace.branch.latestReleaseInstances.total > 0">
<div class="panel-heading">
<a target="_blank" data-tooltip="tooltip" data-placement="bottom"
title="{{'Component.Namespace.Branch.Instance.ItemToSee' | translate }}"
ng-href="{{ '/config/history.html' | prefixPath }}?#/appid={{appId}}&env={{env}}&clusterName={{namespace.baseInfo.clusterName}}&namespaceName={{namespace.baseInfo.namespaceName}}&releaseId={{namespace.branch.latestRelease.id}}">
{{namespace.branch.latestRelease.name}}
</a>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<td>{{'Component.Namespace.Branch.Instance.InstanceAppId' | translate }}</td>
<td>{{'Component.Namespace.Branch.Instance.InstanceClusterName' | translate }}</td>
<td>{{'Component.Namespace.Branch.Instance.InstanceDataCenter' | translate }}</td>
<td>{{'Component.Namespace.Branch.Instance.InstanceIp' | translate }}</td>
<td>{{'Component.Namespace.Branch.Instance.InstanceGetItemTime' | translate }}</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="instance in namespace.branch.latestReleaseInstances.content">
<td width="20%" ng-bind="instance.appId"></td>
<td width="20%" ng-bind="instance.clusterName"></td>
<td width="20%" ng-bind="instance.dataCenter"></td>
<td width="20%" ng-bind="instance.ip"></td>
<td width="20%">{{instance.configs && instance.configs.length ?
(instance.configs[0].releaseDeliveryTime | date: 'yyyy-MM-dd HH:mm:ss') : ''}}
</td>
</tr>
</tbody>
</table>
<div class="row text-center"
ng-show="namespace.branch.latestReleaseInstances.content.length < namespace.branch.latestReleaseInstances.total">
<button class="btn btn-default"
ng-click="loadInstanceInfo(namespace.branch)">{{'Component.Namespace.Branch.Instance.LoadMore' | translate }}</button>
</div>
</div>
<div class="text-center" ng-if="namespace.branch.latestReleaseInstances.total == 0">
{{'Component.Namespace.Branch.Instance.NoInstance' | translate }}
</div>
</div>
</div>
<!--history view-->
<div class="J_historyview history-view" ng-show="namespace.branch.viewType == 'history'">
<div class="media" ng-show="namespace.branch.commits && namespace.branch.commits.length"
ng-repeat="commits in namespace.branch.commits">
<div class="media-body">
<div class="row">
<div class="col-md-6 col-sm-6 ">
<h3 class="media-heading" ng-bind="commits.dataChangeCreatedBy"></h3>
</div>
<div class="col-md-6 col-sm-6 text-right">
<h5 class="media-heading"
ng-bind="commits.dataChangeCreatedTime | date: 'yyyy-MM-dd HH:mm:ss'"></h5>
</div>
</div>
<!--properties format-->
<table class="table table-bordered table-striped text-center table-hover"
style="margin-top: 5px;" ng-if="namespace.isPropertiesFormat">
<thead>
<tr>
<th>
{{'Component.Namespace.Branch.History.ItemType' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemKey' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemOldValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemNewValue' | translate }}
</th>
<th>
{{'Component.Namespace.Branch.History.ItemComment' | translate }}
</th>
</tr>
</thead>
<tbody>
<!--兼容老数据,不显示item类型为空行和注释的item-->
<tr ng-repeat="item in commits.changeSets.createItems" ng-show="item.key">
<td width="6%">
{{'Component.Namespace.Branch.History.NewAdded' | translate }}
</td>
<td width="20%" title="{{item.key}}">
<span ng-bind="item.key | limitTo: 250"></span>
<span ng-bind="item.key.length > 250 ? '...' :''"></span>
</td>
<td width="28%">
</td>
<td width="28%" class="cursor-pointer" title="{{item.value}}"
ng-click="showText(item.value)">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.updateItems">
<td width="6%">
{{'Component.Namespace.Branch.History.Modified' | translate }}
</td>
<td width="20%" title="{{item.newItem.key}}">
<span ng-bind="item.newItem.key | limitTo: 250"></span>
<span ng-bind="item.newItem.key.length > 250 ? '...' :''"></span>
</td>
<td width="28%" class="cursor-pointer" title="{{item.oldItem.value}}"
ng-click="showText(item.oldItem.value)">
<span ng-bind="item.oldItem.value | limitTo: 250"></span>
<span ng-bind="item.oldItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="28%" class="cursor-pointer" title="{{item.newItem.value}}"
ng-click="showText(item.newItem.value)">
<span ng-bind="item.newItem.value | limitTo: 250"></span>
<span ng-bind="item.newItem.value.length > 250 ? '...': ''"></span>
</td>
<td width="18%" title="{{item.newItem.comment}}">
<span ng-bind="item.newItem.comment | limitTo: 250"></span>
<span ng-bind="item.newItem.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
<tr ng-repeat="item in commits.changeSets.deleteItems"
ng-show="item.key || item.comment">
<td width="6%">
{{'Component.Namespace.Branch.History.Deleted' | translate }}
</td>
<td width="20%" title="{{item.key}}">
<span ng-bind="item.key | limitTo: 250"></span>
<span ng-bind="item.key.length > 250 ? '...' :''"></span>
</td>
<td width="28%" title="{{item.value}}">
<span ng-bind="item.value | limitTo: 250"></span>
<span ng-bind="item.value.length > 250 ? '...': ''"></span>
</td>
<td width="28%">
</td>
<td width="18%" title="{{item.comment}}">
<span ng-bind="item.comment | limitTo: 250"></span>
<span ng-bind="item.comment.length > 250 ?'...' : ''"></span>
</td>
</tr>
</tbody>
</table>
<!--not properties format-->
<div ng-if="!namespace.isPropertiesFormat">
<div ng-repeat="item in commits.changeSets.createItems">
<textarea class="form-control no-radius" rows="20" ng-disabled="true"
ng-bind="item.value">
</textarea>
</div>
<div ng-repeat="item in commits.changeSets.updateItems">
<textarea class="form-control no-radius" rows="20" ng-disabled="true"
ng-bind="item.newItem.value">
</textarea>
</div>
</div>
</div>
<hr>
</div>
<div class="text-center">
<button type="button" class="btn btn-default" ng-show="!namespace.branch.hasLoadAllCommit"
ng-click="loadCommitHistory(namespace.branch)">{{'Component.Namespace.Branch.History.LoadMore' | translate }}
<span class="glyphicon glyphicon-menu-down"></span></button>
</div>
<div class="empty-container text-center"
ng-show="!namespace.branch.commits || !namespace.branch.commits.length">
{{'Component.Namespace.Branch.History.NoHistory' | translate }}
</div>
</div>
</section>
</div>
</section> | -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-client/src/main/java/com/ctrip/framework/apollo/spi/ConfigFactoryManager.java | package com.ctrip.framework.apollo.spi;
/**
* @author Jason Song([email protected])
*/
public interface ConfigFactoryManager {
/**
* Get the config factory for the namespace.
*
* @param namespace the namespace
* @return the config factory for this namespace
*/
ConfigFactory getFactory(String namespace);
}
| package com.ctrip.framework.apollo.spi;
/**
* @author Jason Song([email protected])
*/
public interface ConfigFactoryManager {
/**
* Get the config factory for the namespace.
*
* @param namespace the namespace
* @return the config factory for this namespace
*/
ConfigFactory getFactory(String namespace);
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-core/src/main/java/com/ctrip/framework/apollo/tracer/Tracer.java | package com.ctrip.framework.apollo.tracer;
import com.ctrip.framework.apollo.tracer.internals.NullMessageProducerManager;
import com.ctrip.framework.apollo.tracer.spi.MessageProducer;
import com.ctrip.framework.apollo.tracer.spi.MessageProducerManager;
import com.ctrip.framework.apollo.tracer.spi.Transaction;
import com.ctrip.framework.foundation.internals.ServiceBootstrap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Jason Song([email protected])
*/
public abstract class Tracer {
private static final Logger logger = LoggerFactory.getLogger(Tracer.class);
private static final MessageProducerManager NULL_MESSAGE_PRODUCER_MANAGER =
new NullMessageProducerManager();
private static volatile MessageProducerManager producerManager;
private static Object lock = new Object();
static {
getProducer();
}
private static MessageProducer getProducer() {
try {
if (producerManager == null) {
synchronized (lock) {
if (producerManager == null) {
producerManager = ServiceBootstrap.loadFirst(MessageProducerManager.class);
}
}
}
} catch (Throwable ex) {
logger.error(
"Failed to initialize message producer manager, use null message producer manager.", ex);
producerManager = NULL_MESSAGE_PRODUCER_MANAGER;
}
return producerManager.getProducer();
}
public static void logError(String message, Throwable cause) {
try {
getProducer().logError(message, cause);
} catch (Throwable ex) {
logger.warn("Failed to log error for message: {}, cause: {}", message, cause, ex);
}
}
public static void logError(Throwable cause) {
try {
getProducer().logError(cause);
} catch (Throwable ex) {
logger.warn("Failed to log error for cause: {}", cause, ex);
}
}
public static void logEvent(String type, String name) {
try {
getProducer().logEvent(type, name);
} catch (Throwable ex) {
logger.warn("Failed to log event for type: {}, name: {}", type, name, ex);
}
}
public static void logEvent(String type, String name, String status, String nameValuePairs) {
try {
getProducer().logEvent(type, name, status, nameValuePairs);
} catch (Throwable ex) {
logger.warn("Failed to log event for type: {}, name: {}, status: {}, nameValuePairs: {}",
type, name, status, nameValuePairs, ex);
}
}
public static Transaction newTransaction(String type, String name) {
try {
return getProducer().newTransaction(type, name);
} catch (Throwable ex) {
logger.warn("Failed to create transaction for type: {}, name: {}", type, name, ex);
return NULL_MESSAGE_PRODUCER_MANAGER.getProducer().newTransaction(type, name);
}
}
}
| package com.ctrip.framework.apollo.tracer;
import com.ctrip.framework.apollo.tracer.internals.NullMessageProducerManager;
import com.ctrip.framework.apollo.tracer.spi.MessageProducer;
import com.ctrip.framework.apollo.tracer.spi.MessageProducerManager;
import com.ctrip.framework.apollo.tracer.spi.Transaction;
import com.ctrip.framework.foundation.internals.ServiceBootstrap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
/**
* @author Jason Song([email protected])
*/
public abstract class Tracer {
private static final Logger logger = LoggerFactory.getLogger(Tracer.class);
private static final MessageProducerManager NULL_MESSAGE_PRODUCER_MANAGER =
new NullMessageProducerManager();
private static volatile MessageProducerManager producerManager;
private static Object lock = new Object();
static {
getProducer();
}
private static MessageProducer getProducer() {
try {
if (producerManager == null) {
synchronized (lock) {
if (producerManager == null) {
producerManager = ServiceBootstrap.loadFirst(MessageProducerManager.class);
}
}
}
} catch (Throwable ex) {
logger.error(
"Failed to initialize message producer manager, use null message producer manager.", ex);
producerManager = NULL_MESSAGE_PRODUCER_MANAGER;
}
return producerManager.getProducer();
}
public static void logError(String message, Throwable cause) {
try {
getProducer().logError(message, cause);
} catch (Throwable ex) {
logger.warn("Failed to log error for message: {}, cause: {}", message, cause, ex);
}
}
public static void logError(Throwable cause) {
try {
getProducer().logError(cause);
} catch (Throwable ex) {
logger.warn("Failed to log error for cause: {}", cause, ex);
}
}
public static void logEvent(String type, String name) {
try {
getProducer().logEvent(type, name);
} catch (Throwable ex) {
logger.warn("Failed to log event for type: {}, name: {}", type, name, ex);
}
}
public static void logEvent(String type, String name, String status, String nameValuePairs) {
try {
getProducer().logEvent(type, name, status, nameValuePairs);
} catch (Throwable ex) {
logger.warn("Failed to log event for type: {}, name: {}, status: {}, nameValuePairs: {}",
type, name, status, nameValuePairs, ex);
}
}
public static Transaction newTransaction(String type, String name) {
try {
return getProducer().newTransaction(type, name);
} catch (Throwable ex) {
logger.warn("Failed to create transaction for type: {}, name: {}", type, name, ex);
return NULL_MESSAGE_PRODUCER_MANAGER.getProducer().newTransaction(type, name);
}
}
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/openapi/v1/controller/AppController.java | package com.ctrip.framework.apollo.openapi.v1.controller;
import com.ctrip.framework.apollo.common.dto.ClusterDTO;
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.portal.environment.Env;
import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO;
import com.ctrip.framework.apollo.openapi.util.OpenApiBeanUtils;
import com.ctrip.framework.apollo.portal.component.PortalSettings;
import com.ctrip.framework.apollo.portal.service.AppService;
import com.ctrip.framework.apollo.portal.service.ClusterService;
import com.google.common.collect.Sets;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@RestController("openapiAppController")
@RequestMapping("/openapi/v1")
public class AppController {
private final PortalSettings portalSettings;
private final ClusterService clusterService;
private final AppService appService;
public AppController(final PortalSettings portalSettings,
final ClusterService clusterService,
final AppService appService) {
this.portalSettings = portalSettings;
this.clusterService = clusterService;
this.appService = appService;
}
@GetMapping(value = "/apps/{appId}/envclusters")
public List<OpenEnvClusterDTO> loadEnvClusterInfo(@PathVariable String appId){
List<OpenEnvClusterDTO> envClusters = new LinkedList<>();
List<Env> envs = portalSettings.getActiveEnvs();
for (Env env : envs) {
OpenEnvClusterDTO envCluster = new OpenEnvClusterDTO();
envCluster.setEnv(env.name());
List<ClusterDTO> clusterDTOs = clusterService.findClusters(env, appId);
envCluster.setClusters(BeanUtils.toPropertySet("name", clusterDTOs));
envClusters.add(envCluster);
}
return envClusters;
}
@GetMapping("/apps")
public List<OpenAppDTO> findApps(@RequestParam(value = "appIds", required = false) String appIds) {
final List<App> apps = new ArrayList<>();
if (StringUtils.isEmpty(appIds)) {
apps.addAll(appService.findAll());
} else {
apps.addAll(appService.findByAppIds(Sets.newHashSet(appIds.split(","))));
}
return OpenApiBeanUtils.transformFromApps(apps);
}
}
| package com.ctrip.framework.apollo.openapi.v1.controller;
import com.ctrip.framework.apollo.common.dto.ClusterDTO;
import com.ctrip.framework.apollo.common.entity.App;
import com.ctrip.framework.apollo.common.utils.BeanUtils;
import com.ctrip.framework.apollo.portal.environment.Env;
import com.ctrip.framework.apollo.openapi.dto.OpenAppDTO;
import com.ctrip.framework.apollo.openapi.dto.OpenEnvClusterDTO;
import com.ctrip.framework.apollo.openapi.util.OpenApiBeanUtils;
import com.ctrip.framework.apollo.portal.component.PortalSettings;
import com.ctrip.framework.apollo.portal.service.AppService;
import com.ctrip.framework.apollo.portal.service.ClusterService;
import com.google.common.collect.Sets;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@RestController("openapiAppController")
@RequestMapping("/openapi/v1")
public class AppController {
private final PortalSettings portalSettings;
private final ClusterService clusterService;
private final AppService appService;
public AppController(final PortalSettings portalSettings,
final ClusterService clusterService,
final AppService appService) {
this.portalSettings = portalSettings;
this.clusterService = clusterService;
this.appService = appService;
}
@GetMapping(value = "/apps/{appId}/envclusters")
public List<OpenEnvClusterDTO> loadEnvClusterInfo(@PathVariable String appId){
List<OpenEnvClusterDTO> envClusters = new LinkedList<>();
List<Env> envs = portalSettings.getActiveEnvs();
for (Env env : envs) {
OpenEnvClusterDTO envCluster = new OpenEnvClusterDTO();
envCluster.setEnv(env.name());
List<ClusterDTO> clusterDTOs = clusterService.findClusters(env, appId);
envCluster.setClusters(BeanUtils.toPropertySet("name", clusterDTOs));
envClusters.add(envCluster);
}
return envClusters;
}
@GetMapping("/apps")
public List<OpenAppDTO> findApps(@RequestParam(value = "appIds", required = false) String appIds) {
final List<App> apps = new ArrayList<>();
if (StringUtils.isEmpty(appIds)) {
apps.addAll(appService.findAll());
} else {
apps.addAll(appService.findByAppIds(Sets.newHashSet(appIds.split(","))));
}
return OpenApiBeanUtils.transformFromApps(apps);
}
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/UserInfoHolder.java | package com.ctrip.framework.apollo.portal.spi;
import com.ctrip.framework.apollo.portal.entity.bo.UserInfo;
/**
* Get access to the user's information,
* different companies should have a different implementation
*/
public interface UserInfoHolder {
UserInfo getUser();
}
| package com.ctrip.framework.apollo.portal.spi;
import com.ctrip.framework.apollo.portal.entity.bo.UserInfo;
/**
* Get access to the user's information,
* different companies should have a different implementation
*/
public interface UserInfoHolder {
UserInfo getUser();
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/java/com/ctrip/framework/apollo/portal/spi/ctrip/CtripEmailRequestBuilder.java | package com.ctrip.framework.apollo.portal.spi.ctrip;
import com.ctrip.framework.apollo.portal.component.config.PortalConfig;
import com.ctrip.framework.apollo.portal.entity.bo.Email;
import com.ctrip.framework.apollo.tracer.Tracer;
import org.apache.commons.lang.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.lang.reflect.Method;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
public class CtripEmailRequestBuilder {
private static final Logger logger = LoggerFactory.getLogger(CtripEmailRequestBuilder.class);
private static Class sendEmailRequestClazz;
private static Method setBodyContent;
private static Method setRecipient;
private static Method setSendCode;
private static Method setBodyTemplateID;
private static Method setSender;
private static Method setSubject;
private static Method setIsBodyHtml;
private static Method setCharset;
private static Method setExpiredTime;
private static Method setAppID;
@Autowired
private PortalConfig portalConfig;
@PostConstruct
public void init() {
try {
sendEmailRequestClazz = Class.forName("com.ctrip.framework.apolloctripservice.emailservice.SendEmailRequest");
setSendCode = sendEmailRequestClazz.getMethod("setSendCode", String.class);
setBodyTemplateID = sendEmailRequestClazz.getMethod("setBodyTemplateID", Integer.class);
setSender = sendEmailRequestClazz.getMethod("setSender", String.class);
setBodyContent = sendEmailRequestClazz.getMethod("setBodyContent", String.class);
setRecipient = sendEmailRequestClazz.getMethod("setRecipient", List.class);
setSubject = sendEmailRequestClazz.getMethod("setSubject", String.class);
setIsBodyHtml = sendEmailRequestClazz.getMethod("setIsBodyHtml", Boolean.class);
setCharset = sendEmailRequestClazz.getMethod("setCharset", String.class);
setExpiredTime = sendEmailRequestClazz.getMethod("setExpiredTime", Calendar.class);
setAppID = sendEmailRequestClazz.getMethod("setAppID", Integer.class);
} catch (Throwable e) {
logger.error("init email request build failed", e);
Tracer.logError("init email request build failed", e);
}
}
public Object buildEmailRequest(Email email) throws Exception {
Object emailRequest = createBasicEmailRequest();
setSender.invoke(emailRequest, email.getSenderEmailAddress());
setSubject.invoke(emailRequest, email.getSubject());
String emailBodyBuilder = "<entry><content><![CDATA[<!DOCTYPE html>" +
email.getBody() +
"]]></content></entry>";
setBodyContent.invoke(emailRequest, emailBodyBuilder);
setRecipient.invoke(emailRequest, email.getRecipients());
return emailRequest;
}
private Object createBasicEmailRequest() throws Exception {
Object request = sendEmailRequestClazz.newInstance();
setSendCode.invoke(request, portalConfig.sendCode());
setBodyTemplateID.invoke(request, portalConfig.templateId());
setIsBodyHtml.invoke(request, true);
setCharset.invoke(request, "UTF-8");
setExpiredTime.invoke(request, calExpiredTime());
setAppID.invoke(request, portalConfig.appId());
return request;
}
private Calendar calExpiredTime() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(DateUtils.addHours(new Date(), portalConfig.survivalDuration()));
return calendar;
}
}
| package com.ctrip.framework.apollo.portal.spi.ctrip;
import com.ctrip.framework.apollo.portal.component.config.PortalConfig;
import com.ctrip.framework.apollo.portal.entity.bo.Email;
import com.ctrip.framework.apollo.tracer.Tracer;
import org.apache.commons.lang.time.DateUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.lang.reflect.Method;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import javax.annotation.PostConstruct;
public class CtripEmailRequestBuilder {
private static final Logger logger = LoggerFactory.getLogger(CtripEmailRequestBuilder.class);
private static Class sendEmailRequestClazz;
private static Method setBodyContent;
private static Method setRecipient;
private static Method setSendCode;
private static Method setBodyTemplateID;
private static Method setSender;
private static Method setSubject;
private static Method setIsBodyHtml;
private static Method setCharset;
private static Method setExpiredTime;
private static Method setAppID;
@Autowired
private PortalConfig portalConfig;
@PostConstruct
public void init() {
try {
sendEmailRequestClazz = Class.forName("com.ctrip.framework.apolloctripservice.emailservice.SendEmailRequest");
setSendCode = sendEmailRequestClazz.getMethod("setSendCode", String.class);
setBodyTemplateID = sendEmailRequestClazz.getMethod("setBodyTemplateID", Integer.class);
setSender = sendEmailRequestClazz.getMethod("setSender", String.class);
setBodyContent = sendEmailRequestClazz.getMethod("setBodyContent", String.class);
setRecipient = sendEmailRequestClazz.getMethod("setRecipient", List.class);
setSubject = sendEmailRequestClazz.getMethod("setSubject", String.class);
setIsBodyHtml = sendEmailRequestClazz.getMethod("setIsBodyHtml", Boolean.class);
setCharset = sendEmailRequestClazz.getMethod("setCharset", String.class);
setExpiredTime = sendEmailRequestClazz.getMethod("setExpiredTime", Calendar.class);
setAppID = sendEmailRequestClazz.getMethod("setAppID", Integer.class);
} catch (Throwable e) {
logger.error("init email request build failed", e);
Tracer.logError("init email request build failed", e);
}
}
public Object buildEmailRequest(Email email) throws Exception {
Object emailRequest = createBasicEmailRequest();
setSender.invoke(emailRequest, email.getSenderEmailAddress());
setSubject.invoke(emailRequest, email.getSubject());
String emailBodyBuilder = "<entry><content><![CDATA[<!DOCTYPE html>" +
email.getBody() +
"]]></content></entry>";
setBodyContent.invoke(emailRequest, emailBodyBuilder);
setRecipient.invoke(emailRequest, email.getRecipients());
return emailRequest;
}
private Object createBasicEmailRequest() throws Exception {
Object request = sendEmailRequestClazz.newInstance();
setSendCode.invoke(request, portalConfig.sendCode());
setBodyTemplateID.invoke(request, portalConfig.templateId());
setIsBodyHtml.invoke(request, true);
setCharset.invoke(request, "UTF-8");
setExpiredTime.invoke(request, calExpiredTime());
setAppID.invoke(request, portalConfig.appId());
return request;
}
private Calendar calExpiredTime() {
Calendar calendar = Calendar.getInstance();
calendar.setTime(DateUtils.addHours(new Date(), portalConfig.survivalDuration()));
return calendar;
}
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-common/src/main/java/com/ctrip/framework/apollo/common/controller/WebMvcConfig.java | package com.ctrip.framework.apollo.common.controller;
import java.util.List;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.MimeMappings;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer, WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver pageResolver =
new PageableHandlerMethodArgumentResolver();
pageResolver.setFallbackPageable(PageRequest.of(0, 10));
argumentResolvers.add(pageResolver);
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.favorPathExtension(false);
}
@Override
public void customize(TomcatServletWebServerFactory factory) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
mappings.add("html", "text/html;charset=utf-8");
factory.setMimeMappings(mappings );
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// 10 days
addCacheControl(registry, "img", 864000);
addCacheControl(registry, "vendor", 864000);
addCacheControl(registry, "scripts", 864000);
addCacheControl(registry, "styles", 864000);
// 1 day
addCacheControl(registry, "views", 86400);
addCacheControl(registry, "i18n", 86400);
}
private void addCacheControl(ResourceHandlerRegistry registry, String folder, int cachePeriod) {
registry.addResourceHandler(String.format("/%s/**", folder))
.addResourceLocations(String.format("classpath:/static/%s/", folder))
.setCachePeriod(cachePeriod);
}
}
| package com.ctrip.framework.apollo.common.controller;
import java.util.List;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.MimeMappings;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.web.PageableHandlerMethodArgumentResolver;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.ContentNegotiationConfigurer;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class WebMvcConfig implements WebMvcConfigurer, WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
@Override
public void addArgumentResolvers(List<HandlerMethodArgumentResolver> argumentResolvers) {
PageableHandlerMethodArgumentResolver pageResolver =
new PageableHandlerMethodArgumentResolver();
pageResolver.setFallbackPageable(PageRequest.of(0, 10));
argumentResolvers.add(pageResolver);
}
@Override
public void configureContentNegotiation(ContentNegotiationConfigurer configurer) {
configurer.favorPathExtension(false);
}
@Override
public void customize(TomcatServletWebServerFactory factory) {
MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
mappings.add("html", "text/html;charset=utf-8");
factory.setMimeMappings(mappings );
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
// 10 days
addCacheControl(registry, "img", 864000);
addCacheControl(registry, "vendor", 864000);
addCacheControl(registry, "scripts", 864000);
addCacheControl(registry, "styles", 864000);
// 1 day
addCacheControl(registry, "views", 86400);
addCacheControl(registry, "i18n", 86400);
}
private void addCacheControl(ResourceHandlerRegistry registry, String folder, int cachePeriod) {
registry.addResourceHandler(String.format("/%s/**", folder))
.addResourceLocations(String.format("classpath:/static/%s/", folder))
.setCachePeriod(cachePeriod);
}
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-core/src/test/java/com/ctrip/framework/apollo/core/enums/EnvUtilsTest.java | package com.ctrip.framework.apollo.core.enums;
import static org.junit.Assert.*;
import org.junit.Test;
public class EnvUtilsTest {
@Test
public void testTransformEnv() throws Exception {
assertEquals(Env.DEV, EnvUtils.transformEnv(Env.DEV.name()));
assertEquals(Env.FAT, EnvUtils.transformEnv(Env.FAT.name().toLowerCase()));
assertEquals(Env.UAT, EnvUtils.transformEnv(" " + Env.UAT.name().toUpperCase() + ""));
assertEquals(Env.UNKNOWN, EnvUtils.transformEnv("someInvalidEnv"));
}
@Test
public void testFromString() throws Exception {
assertEquals(Env.DEV, Env.fromString(Env.DEV.name()));
assertEquals(Env.FAT, Env.fromString(Env.FAT.name().toLowerCase()));
assertEquals(Env.UAT, Env.fromString(" " + Env.UAT.name().toUpperCase() + ""));
}
@Test(expected = IllegalArgumentException.class)
public void testFromInvalidString() throws Exception {
Env.fromString("someInvalidEnv");
}
}
| package com.ctrip.framework.apollo.core.enums;
import static org.junit.Assert.*;
import org.junit.Test;
public class EnvUtilsTest {
@Test
public void testTransformEnv() throws Exception {
assertEquals(Env.DEV, EnvUtils.transformEnv(Env.DEV.name()));
assertEquals(Env.FAT, EnvUtils.transformEnv(Env.FAT.name().toLowerCase()));
assertEquals(Env.UAT, EnvUtils.transformEnv(" " + Env.UAT.name().toUpperCase() + ""));
assertEquals(Env.UNKNOWN, EnvUtils.transformEnv("someInvalidEnv"));
}
@Test
public void testFromString() throws Exception {
assertEquals(Env.DEV, Env.fromString(Env.DEV.name()));
assertEquals(Env.FAT, Env.fromString(Env.FAT.name().toLowerCase()));
assertEquals(Env.UAT, Env.fromString(" " + Env.UAT.name().toUpperCase() + ""));
}
@Test(expected = IllegalArgumentException.class)
public void testFromInvalidString() throws Exception {
Env.fromString("someInvalidEnv");
}
}
| -1 |
apolloconfig/apollo | 3,488 | switch off console appenders when running as backend services |
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| nobodyiam | "2021-01-10T05:01:31Z" | "2021-01-10T06:11:12Z" | 41519f41fa390404c10d48a85e42de135f140aa2 | 137d70e7ba47ad74aa6766a1e8fb7f087038e00e | switch off console appenders when running as backend services.
## What's the purpose of this PR
switch off console appenders when running as backend services
## Which issue(s) this PR fixes:
Fixes #3272 #2459
## Brief changelog
1. add `LOG_APPENDERS` environment variables to make logback appenders switchable
2. set `LOG_APPENDERS=FILE` when running as backend services
3. upgrade spring-boot-maven-plugin to 2.0.5.RELEASE
Follow this checklist to help us incorporate your contribution quickly and easily:
- [x] Read the [Contributing Guide](https://github.com/ctripcorp/apollo/blob/master/CONTRIBUTING.md) before making this pull request.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit tests to verify the code.
- [x] Run `mvn clean test` to make sure this pull request doesn't break anything.
| ./apollo-portal/src/main/resources/static/img/syntax.png | PNG
IHDR kXT gAMA a cHRM z& |