Skip to content

Commit

Permalink
playframework#1367 fix carriage return
Browse files Browse the repository at this point in the history
- fix rebase conflict
  • Loading branch information
xael-fry committed Jan 31, 2022
1 parent 7ccf446 commit 57395d5
Show file tree
Hide file tree
Showing 6 changed files with 56 additions and 48 deletions.
13 changes: 6 additions & 7 deletions framework/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require: &allDependencies
- com.google.code.gson -> gson 2.8.9
- com.jamonapi -> jamon 2.82
- com.ning -> async-http-client 1.9.40
- commons-beanutils 1.9.4
- commons-beanutils 1.9.4
- commons-codec 1.15
- org.apache.commons -> commons-email 1.5
- commons-fileupload 1.4
Expand Down Expand Up @@ -71,7 +71,6 @@ require: &allDependencies
- io.netty -> netty 3.10.6.Final
- org.postgresql -> postgresql 42.3.1
- org.slf4j -> slf4j-api 1.7.33
- org.slf4j -> slf4j-log4j12 1.7.33
- org.apache.logging.log4j -> log4j-slf4j-impl 2.17.1
- org.yaml -> snakeyaml 1.30
- net.spy -> spymemcached 2.12.3
Expand All @@ -92,7 +91,7 @@ repositories:
type: local
artifact: "${play.path}/framework/lib/[artifact]-[revision].jar"
contains: *allDependencies

- playCoreCrud:
type: local
artifact: "${play.path}/modules/crud"
Expand All @@ -104,16 +103,16 @@ repositories:
artifact: "${play.path}/modules/secure"
contains:
- play -> secure $version

- playCoreDocviewer:
type: local
artifact: "${play.path}/modules/docviewer"
contains:
- play -> docviewer $version

- playModules:
- playModules:
type: chain
using:
using:
- playLocalModules:
type: local
descriptor: "${play.path}/modules/[module]-[revision]/conf/dependencies.yml"
Expand All @@ -123,7 +122,7 @@ repositories:
type: http
descriptor: "https://www.playframework.com/modules/repo/[module]/[revision]/dependencies.yml"
artifact: "https://www.playframework.com/modules/[module]-[revision].zip"

contains:
- play -> *

Expand Down
Binary file removed framework/lib/slf4j-api-1.7.32.jar
Binary file not shown.
Binary file removed framework/lib/slf4j-log4j12-1.7.33.jar
Binary file not shown.
12 changes: 10 additions & 2 deletions framework/test-src/play/LoggerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,14 @@ public void tearDown() throws Exception {
*/
@Test
public void testInitWithPropertiesForDefaultRoot() {
File config = new File(Play.applicationPath.getAbsoluteFile() + "/test-src/play/testlog4j.properties");
System.out.println(config.getAbsoluteFile());

//given
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, Play.applicationPath.getAbsoluteFile() + "/test-src/play/testlog4j.properties");
Play.configuration.put(APPLICATION_LOG_PATH_PROPERTYNAME, config.getAbsoluteFile());

System.out.println(Play.applicationPath.getAbsoluteFile() + "/test-src/play/testlog4j.properties");

Logger.log4j = null;
init();
//when
Expand Down Expand Up @@ -155,9 +161,11 @@ private void init() {
@Override
public URL getLog4jConf() {
try {
System.out.println(Play.configuration.getProperty(APPLICATION_LOG_PATH_PROPERTYNAME));

return new File(Play.configuration.getProperty(APPLICATION_LOG_PATH_PROPERTYNAME)).toURI().toURL();
} catch (MalformedURLException ignored) {

System.out.println(ignored.getMessage());
}
return super.getLog4jConf();
}
Expand Down
33 changes: 17 additions & 16 deletions framework/test-src/play/testlog4j.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# appender Console
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d [%t] %p %c - %m%n
appender.console.filter.threshold.type = ThresholdFilter
appender.console.filter.threshold.level = INFO
# play logger
logger.app.name = play
logger.app.level = INFO
# play logger
logger.custom.name = logtest.properties
logger.custom.level = WARN
# root logger
rootLogger.level = DEBUG
rootLogger.appenderRef.console.ref = STDOUT
# appender Console
appender.console.type = Console
appender.console.name = STDOUT
appender.console.layout.type = PatternLayout
appender.console.layout.pattern = %d [%t] %p %c - %m%n
appender.console.filter.threshold.type = ThresholdFilter
appender.console.filter.threshold.level = INFO
# play logger
logger.app.name = play
logger.app.level = INFO
# play logger
logger.custom.name = logtest.properties
logger.custom.level = WARN
# root logger
rootLogger.level = DEBUG
rootLogger.appenderRef.console.ref = STDOUT

46 changes: 23 additions & 23 deletions framework/test-src/play/testlog4j.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<Configuration name="ConfigTest" status="ERROR" monitorInterval="5">
<Appenders>

<SystemPropertyArbiter propertyName="env" propertyValue="dev">
<Console name="Out">
<PatternLayout pattern="%m%n"/>
</Console>
</SystemPropertyArbiter>
<SystemPropertyArbiter propertyName="env" propertyValue="prod">
<List name="Out">
</List>
</SystemPropertyArbiter>

</Appenders>
<Loggers>
<Logger name="logtest.xml" level="trace" >
<AppenderRef ref="Out"/>
</Logger>
<Root level="debug">
<AppenderRef ref="Out"/>
</Root>
</Loggers>
</Configuration>
<Configuration name="ConfigTest" status="ERROR" monitorInterval="5">
<Appenders>

<SystemPropertyArbiter propertyName="env" propertyValue="dev">
<Console name="Out">
<PatternLayout pattern="%m%n"/>
</Console>
</SystemPropertyArbiter>
<SystemPropertyArbiter propertyName="env" propertyValue="prod">
<List name="Out">
</List>
</SystemPropertyArbiter>

</Appenders>
<Loggers>
<Logger name="logtest.xml" level="trace" >
<AppenderRef ref="Out"/>
</Logger>
<Root level="debug">
<AppenderRef ref="Out"/>
</Root>
</Loggers>
</Configuration>

0 comments on commit 57395d5

Please sign in to comment.