`
反求诸己
  • 浏览: 545297 次
  • 性别: Icon_minigender_1
  • 来自: 湖南娄底
社区版块
存档分类
最新评论

Log4J use for different files

 
阅读更多

Log4J use for different files

if u want create a new log file for action e.g click108action

step 1 create log4j appender
#Click108Appender
log4j.appender.click108=biz.minaret.log4j.DatedFileAppender
log4j.appender.click108.layout=org.apache.log4j.PatternLayout
log4j.appender.click108.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %5p %c{1}:%L - %m%n
log4j.appender.click108.encoding=UTF-8
log4j.appender.click108.Directory=c:\\temp
log4j.appender.click108.Prefix=click108.
log4j.appender.click108.Suffix=.log
log4j.appender.click108.Append=true
log4j.appender.click108.BufferedIO=false
log4j.appender.click108.BufferSize=8192

step 2 append logger name
log4j.logger.click108=info,click108

step 3 getlogger
private static Logger log = Logger.getLogger("click108");

while call the log.info() that will create a new log file named click108+datetime in c:\temp

分享到:
评论

相关推荐

    erlang日志应用log4erl(非sasl)

    - Support for a log formatter (similar to Layouts in Log4J) - Support for console log - Support for smtp formatter - Support for XML logs - Support for syslog - Support for changing format and level ...

    Java - J2EE Job Interview Companion.pdf

    Log4j is an open-source logging utility designed for Java applications. It provides a flexible and powerful mechanism to log messages and errors within a Java program. Developed by the Apache Software...

    Inputlog 软件

    to generate data files for statistical, text, pause and mode analyses. The generated files can be exported to statistical programs such as SPSS and SAS. to integrate various types of data from other ...

    UE(官方下载)

    Use UltraEdit's built-in handling for character-separated value files Word wrap and tab settings for different file types UltraEdit and UEStudio allow you to customize the word wrap and tab settings ...

    Adapting AWStats for IBM WebSphere Portal 6.0.x and virtual portals

    3. **prepare_parsing.sh:** Prepares the log files for parsing. 4. **parseSALog.pl:** Parses the log files and extracts relevant information. 5. **exprequest.xml:** Defines XML export rules. 6. *...

    oracle 10g-admin1 考试试题

    After the database reaches the MOUNT state, further steps are taken to make the datafiles and redolog files available for use. Once the database is opened, users can access the database and its ...

    Editor Console Pro v3.964.unitypackage

    - Parse Editor.log or other log files as if they were the current logs - Colorize the entire log line so you can quickly see different log types. - Use custom fonts and colors. - Copy full logs and ...

    Foundations for Analytics with Python O-Reilly-2016-Clinton W. Brownley

    Next, the chapter discusses how to use three different types of conditional logic to filter for specific rows from the input file and write them to a CSV output file. Then the chapter presents two ...

    STG (SNMP Traffic Grapher)

    Rotate N Log Files - specifies number of log files to rotate - minimum 1. Rotated files will have numeric extention added: *.000 *.001 etc. Every N Hour(s) or Day(s) or Week(s) or Month(s) - ...

    BURNINTEST--硬件检测工具

    Use a version of BurnInTest prior to 5.2 for compatibility with W98 and ME. Windows 95 and Windows NT ========================= Windows 95 and NT are not supported in BurnInTest version 4.0 and above...

    EurekaLog_7.5.0.0_Enterprise

    Use 0 (default) for small projects, use 1 for large projects (if ecc32 runs out of memory). 2)....Added: --el_DisableDebuggerPresent command-line option for compatibility with 3rd party debuggers ...

    NTFS Documentation

    Stores a unique identifier for the file, allowing for the identification of files across different volumes. ##### Attribute - $SECURITY_DESCRIPTOR (0x50) Holds security-related information, such as ...

    drupal 6.12

    the mod_rewrite module and the ability to use local .htaccess files. For Clean URLs support on IIS, see "Using Clean URLs with IIS" (http://drupal.org/node/3854) in the Drupal handbook. - Various ...

    8-07-14_MegaCLI for linux_windows

    SCGCQ00322216 EnhancementRequest Help files for Perfmode in adp(set/get)prop are added. SCGCQ00322234 EnhancementRequest Utilities to show logical block size [AF512e, 512n, 4Kn,..] SCGCQ00322257 ...

    windows下命令行发送邮件

    Optionally, blat can also attach multiple binary files to your message and comes with a variety of different switches including HTML format, subject line, bcc, return receipt and many others. ...

    Cody‘s_Data_Cleaning_Techniques_Using_SAS_(Second_Edtion)

    - **Inspecting the SAS Log**: Explains how to inspect the SAS log for indications of missing values. - **Using PROC MEANS and PROC FREQ to Count Missing Values**: Demonstrates using these procedures ...

    BSD Hacks.pdf

    12. **Customizing the Default Boot Menu (HACK 24):** Instructions for customizing the boot menu, including adding entries for different operating systems or kernel configurations. 13. **Protecting ...

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持D4-XE5

    FastReport.v4.15 for.Delphi.BCB.Full.Source企业版含ClientServer中文修正版支持Delphi 4-XE5 and C++Builder 6-XE5. D2010以上版本(D14_D19)安装必读 delphi2010以上版本(D14_D19)使用者安装时,请将res\frccD14_...

    eac3to V3.17

    * fixed: dialnorm removal (for Nero decoder) failed with some 2.0 TrueHD files v3.16 * added undocumented "-no2ndpass" switch to turn off 2nd pass processing * fixed: two pass processing sometimes ...

Global site tag (gtag.js) - Google Analytics