This repository has been archived by the owner on Sep 9, 2024. It is now read-only.
forked from informatici/openhospital-api
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OP-1239: re-enable logging to a physical file (informatici#447)
- Loading branch information
1 parent
55f7095
commit 0dab980
Showing
5 changed files
with
61 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
status = INFO | ||
rootLogger.level = INFO | ||
rootLogger.appenderRef.console.ref = STDOUT | ||
rootLogger.appenderRef.rolling.ref = RollingFile | ||
|
||
# Direct log messages to STDOUT | ||
appender.console.type = Console | ||
appender.console.name = STDOUT | ||
appender.console.layout.type = PatternLayout | ||
appender.console.layout.pattern = [%d{dd/MMM/yyyy HH:mm:ss}] [%X{OHUserGroup}:%X{OHUser}] %-p - %m%n | ||
|
||
# File Appender (with classes), daily rotation | ||
appender.rolling.type = RollingFile | ||
appender.rolling.name = RollingFile | ||
appender.rolling.fileName= LOG_DEST/openhospital.log | ||
appender.rolling.filePattern= LOG_DEST/openhospital.log.%d{yyyy-MM-dd} | ||
appender.rolling.layout.type = PatternLayout | ||
appender.rolling.layout.pattern = [%d{dd/MMM/yyyy HH:mm:ss}] [%X{OHUserGroup}:%X{OHUser}] %-p - %m (%l)%n | ||
appender.rolling.policies.type = Policies | ||
# To change log file every day | ||
appender.rolling.policies.time.type = TimeBasedTriggeringPolicy | ||
appender.rolling.policies.time.interval = 1 | ||
appender.rolling.policies.time.modulate = true | ||
|
||
|
||
# DB Appender (table columns) | ||
appender.jdbc.type = JDBC | ||
appender.jdbc.name = jdbc | ||
appender.jdbc.connectionSource.driverClassName = com.mysql.cj.jdbc.Driver | ||
appender.jdbc.connectionSource.type = DriverManager | ||
appender.jdbc.connectionSource.connectionString = dbc:mysql://DBSERVER:DBPORT/DBNAME?autoReconnect=true | ||
appender.jdbc.connectionSource.userName = DBUSER | ||
appender.jdbc.connectionSource.password = DBPASS | ||
appender.jdbc.tableName = logs | ||
appender.jdbc.ignoreExceptions = false | ||
appender.jdbc.columnConfigs[0].type = COLUMN | ||
appender.jdbc.columnConfigs[0].name = LOG_TIME | ||
appender.jdbc.columnConfigs[0].pattern = %d | ||
appender.jdbc.columnConfigs[0].isUnicode = false | ||
appender.jdbc.columnConfigs[1].type = COLUMN | ||
appender.jdbc.columnConfigs[1].name = LOG_LEVEL | ||
appender.jdbc.columnConfigs[1].pattern = %5p | ||
appender.jdbc.columnConfigs[1].isUnicode = false | ||
appender.jdbc.columnConfigs[2].type = COLUMN | ||
appender.jdbc.columnConfigs[2].name = MESSAGE | ||
appender.jdbc.columnConfigs[2].pattern = %mm%ex%n | ||
appender.jdbc.columnConfigs[2].isUnicode = false | ||
|
||
|
||
# Assigning appenders to Hibernate packages (DB loggers) | ||
# - hibernate.SQL to DEBUG for SQL queries to be logged | ||
# - hibernate.type to TRACE for queries parameters to be logged with "binding parameter [?]" | ||
##logger.hibernate-SQL.name=org.hibernate.SQL | ||
##logger.hibernate-SQL.level=DEBUG | ||
## | ||
##logger.hibernate-type.name=org.hibernate.type | ||
##logger.hibernate-type.level=TRACE |