📄 ebanklogconfig.properties
字号:
#
# This defines the logging level for the rootLogger. It is not required
# if you are going to keep the level at debug as the rootLogger by default
# is at the debug level. The value after the comma is the appender for the
# root and we have given it the name R
#
log4j.rootLogger=info, R
#
# For this example, we are just going to log to the console
#
log4j.appender.R=org.apache.log4j.ConsoleAppender
#
# When logging using the ConsoleAppender, the following value tells how and
# what to log. The SimpleLayout simply logs the level of the message and
# the message itself.
#
log4j.appender.R.layout=org.apache.log4j.SimpleLayout
#
# In this configuration we are going to use MDC to log messages for a special
# category that we define in the GetCommentsServlet
# So first define the level of logging for the category and add a new appender
# to it.
#
#log4j.logger.demo.log4j.servlet.GetCommentsServlet=info, R1
#log4j.logger.demo.log4j.servlet.GetCommentsServlet=debug, R1, JDBC2
#log4j.logger.com.ebusiness.ebank.action.CardholderSearchAction=debug, R1, JDBC2, R2
# The following instruction defines a parent logger for the entire application.
# Loggers (i.e. classes) not specified individually in this configuration file will inherit its attributes.
# log4j.logger.com.ebusiness.ebank=debug, R1, JDBC2, R2
# log4j.logger.com.ebusiness.ebank=debug, R2
#
# Since we plan to log to a database, we tell log4j that we will use the
# JDBCAppender. To complete the configuration for this, we need to tell
# some basic things to this appender. Database, Username, password and the
# actual values to log. %m represents the message that will be generated by
# our log statements.
#
#log4j.appender.R1=org.apache.log4j.jdbc.JDBCAppender
log4j.appender.R1=com.emergis.ehealth.inquiry.log.JDBCAuditAppender
#log4j.appender.R1.url=jdbc:oracle:thin:@dboracle:1521:dev
#log4j.appender.R1.username=ebank
#log4j.appender.R1.password=ebank
##log4j.appender.R1.sql=INSERT INTO LOG_JDBCTEST (Log_Date, Logger, Priority, Message) VALUES ('%d','%c','%p','%m')
#log4j.appender.R1.sql=INSERT INTO LOG_JDBCTEST (Log_Date, Logger, Priority, Message, exception) VALUES ('%d','%c','%p','%m','%X{except}')
log4j.appender.R1.sql=INSERT INTO Audit_Log (user_id, logger, action, entity, entity_values, status, failed_reason, duration, log_time) VALUES ({userid}, @CAT@, {action}, {entity}, @MSG@, {status}, {failed_reason}, {duration}, sysdate)
log4j.appender.R1.layout=org.apache.log4j.PatternLayout
log4j.appender.R1.layout.ConversionPattern=[%X{userid}]%m
# JDBC appender directly
# don't forget to load db driver before first log statement in code such as: Class.forName("org.firebirdsql.jdbc.FBDriver");
#log4j.appender.JDBC2=org.apache.log4j.jdbcplus.JDBCAppender
log4j.appender.JDBC2=com.emergis.ehealth.inquiry.log.JDBCAppender
#log4j.appender.JDBC2.url=jdbc:oracle:thin:@dboracle:1521:dev
#log4j.appender.JDBC2.username=ebank
#log4j.appender.JDBC2.password=ebank
#log4j.appender.JDBC2.sql=INSERT INTO LOG_LOG4J2 (MSG) VALUES (@MSG@)
#log4j.appender.JDBC2.sql=INSERT INTO LOGTEST (id, priority, logger, thread, msg, throwable, created_on, created_by) VALUES (@INC@, @PRIO@, @CAT@, @THREAD@, @MSG@, @THROWABLE@, @TIMESTAMP@, 'me')
#log4j.appender.JDBC2.sql=INSERT INTO System_log (msg_id, user_id, priority, logger, thread, msg, exception, log_time, logged_by) VALUES ({msgid}, {userid}, @PRIO@, @CAT@, @THREAD@, @MSG@, substr(@THROWABLE@,0,3999), sysdate, 'Online Banking')
log4j.appender.JDBC2.sql=INSERT INTO System_Log(user_id, priority, logger, thread, msg, exception, log_time) VALUES ({userid}, @PRIO@, @CAT@, @THREAD@, substr(@MSG@, 0, 99), substr(@THROWABLE@,0,3999), sysdate)
log4j.appender.JDBC2.layout=org.apache.log4j.PatternLayout
log4j.appender.JDBC2.layout.ConversionPattern=[%X{userid}]%m
#log4j.appender.JDBC2.buffer=1
log4j.appender.JDBC2.commit=Y
#
# For this we will use the RollingFileAppender and call the log file as MDC.log
#
log4j.appender.R2=org.apache.log4j.RollingFileAppender
log4j.appender.R2.File=./logs/ebank/ebank.log
#
# This is the maximum size of this file, after which it is rolled over. The name
# of the backup file will be MDC.log.1.. and so on. After 2 backups, the file names
# are reused. This is set up by the MaxBackupIndex.
#
log4j.appender.R2.MaxFileSize=10MB
# Keep two backup files
log4j.appender.R2.MaxBackupIndex=2
#
# The layout is the PatternLayout
#
log4j.appender.R2.layout=org.apache.log4j.PatternLayout
#
# and the Conversion pattern includes MDC content (%X{ID})
#
log4j.appender.R2.layout.ConversionPattern=<%d{dd MMM yyyy HH:mm:ss}> - %c - %p - [%X{userid}] - %m%n
# The following are some customer-defined properties values. These values are specific to the
# environment the application could be possibly running on. With these pre-defined properties,
# it can avoid the need to modify this properties file when the codes moves from one environment
# to another environment
# Parent logger configuration. This customized field allows you to
# define logger configuration for each environment
dev.logTarget=debug, R1, JDBC2, R2
qa.logTarget=debug, R1, JDBC2, R2
uat.logTarget=info, R1, JDBC2
prod.logTarget=info, R1, JDBC2
dr.logTarget=info, R1, JDBC2
# log4j.logger.com.ebusiness.ebank=debug, R1, JDBC2, R2
# The url will be automatically determined by application
# log4j.appender.R1.url=jdbc:oracle:thin:@dboracle:1521:dev
# log4j.appender.R1.username=ebank
# log4j.appender.R1.password=ebank
# Dev url
dev.url=jdbc:oracle:thin:@localhost:1521:dev
dev.username=ebank
dev.password=ebank
# QA url
qa.url=jdbc:oracle:thin:@qdboracle:1521:dev
qa.username=ebank
qa.password=ebank
# Uat/staging url
uat.url=jdbc:oracle:thin:@sdboracle:1521:uat
uat.username=ebank
uat.password=ebank
# Prod url
prod.url=jdbc:oracle:thin:@pdboracle:1521:prod
prod.username=ebank
prod.password=ebank
# Disaster Recovery url
dr.url=jdbc:oracle:thin:@ddboracle:1521:dr
dr.username=ebank
dr.password=ebank
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -