Skip to content

Commit

Permalink
default sysout log level is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
samisalkosuo committed Aug 6, 2018
1 parent 9008288 commit 802ca3f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Some environment variables can be used.
- *log_level*, system out logging level.
- 0=no logging of parsed text.
- 1=log elapsed time and excerpt of parsed text.
- Default is 1.
- Default is 0.
- If log_level=0, you can see the latest parsed text by using GET-request to parser.

## Farming
Expand Down
9 changes: 4 additions & 5 deletions server/src/fi/dep/FinDepServletServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class FinDepServletServer {
public static void main(String[] args) {

logger.info("Version {} starting...", ApplicationProperties.getVersionAndBuild());

// Create a basic jetty server object that will listen on port 8080.
// Note that if you set this to port 0 then a randomly available port
// will be assigned that you can either look in the logs for the port,
Expand All @@ -33,12 +33,11 @@ public static void main(String[] args) {
// log level
// 0=no log after start
// 1=log elapsed time and parsed text excerpt
// default is 1
// default is 0
SystemOutLogger SYSOUTLOGGER = SystemOutLogger.getInstance();
String _logLevel = System.getenv("log_level");
if ("0".equals(_logLevel)) {
SYSOUTLOGGER.LOG_LEVEL = 0;
} else {
SYSOUTLOGGER.LOG_LEVEL = 0;
if ("1".equals(_logLevel)) {
SYSOUTLOGGER.LOG_LEVEL = 1;
}
logger.info("System.out log level: {}", SYSOUTLOGGER.LOG_LEVEL);
Expand Down

0 comments on commit 802ca3f

Please sign in to comment.