`
gimgen1026
  • 浏览: 160724 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

log4j.properties input log to file.

    博客分类:
  • Java
阅读更多
# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
log4j.rootLogger=info,CONSOLE,FILE

# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
log4j.appender.CONSOLE.Threshold=INFO
log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
log4j.appender.CONSOLE.layout.ConversionPattern=- %m%n

# LOGFILE is set to be a File appender using a PatternLayout.
log4j.appender.LOGFILE=org.apache.log4j.FileAppender
log4j.appender.LOGFILE.File=axis.log
log4j.appender.LOGFILE.Append=true
log4j.appender.LOGFILE.Threshold=INFO
log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOGFILE.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

#input log to file.
log4j.appender.FILE=org.apache.log4j.RollingFileAppender
log4j.appender.FILE.File=d:/log4j.log
log4j.appender.FILE.MaxFileSize=10mb
log4j.appender.FILE.MaxBackupIndex=3
log4j.appender.FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.FILE.layout.ConversionPattern=%d %5p  (%F:%L) - %m%n
分享到:
评论

相关推荐

    如何在Java工程中使用Log4j

    在src源程序包中添加一个log4j.properties文件,用于配置Log4j的日志记录规则。以下是一个简单的log4j.properties文件示例: ```properties log4j.rootLogger=DEBUG, fileLogger,BORROW log4j.appender.fileLogger=...

    Log4j使用教程

    ### 四、使用Log4j 在Java代码中,我们可以使用以下方式调用Log4j记录日志: ```java import org.apache.log4j.Logger; public class MyClass { private static final Logger logger = Logger.getLogger(MyClass...

    js读取properties文件

    在JavaScript(JS)环境中,读取.properties文件通常用于处理配置数据或者本地化文本。这些文件在Java开发中广泛使用,但JavaScript同样可以借助一些库或技术来读取它们。下面我们将详细探讨如何在JavaScript中实现...

    ssh框架的搭建完整版

    配置log4j,我们需要创建一个`log4j.properties`文件,定义日志级别、输出目的地等: ```properties log4j.rootLogger=DEBUG, FILE log4j.appender.FILE=org.apache.log4j.DailyRollingFileAppender log4j.appender...

    Eclipse打包成JAR包读取外部JAR包和外部配置文件

    input = new FileInputStream("config/config.properties"); // load a properties file prop.load(input); // get the property value and print it out System.out.println(prop.getProperty("key")); } ...

    AJAX框架DWR简单应用.pdf

    3. **配置Log4j属性文件**: 在项目的资源文件夹中创建或复制一个`log4j.properties`文件,内容如下: ```properties log4j.rootLogger=DEBUG,logLocation log4j.appender.logLocation=org.apache.log4j....

    spring-boot-reference.pdf

    4. Working with Spring Boot 5. Learning about Spring Boot Features 6. Moving to Production 7. Advanced Topics II. Getting Started 8. Introducing Spring Boot 9. System Requirements 9.1. Servlet ...

    python3.6.5参考手册 chm

    PEP 529: Change Windows filesystem encoding to UTF-8 PEP 528: Change Windows console encoding to UTF-8 PEP 520: Preserving Class Attribute Definition Order PEP 468: Preserving Keyword Argument ...

    spring-framework-reference4.1.4

    Using Log4J ............................................................................................. 14 II. What’s New in Spring Framework 4.x ......................................................

    EurekaLog_7.5.0.0_Enterprise

    4)....Added "--el_injectjcl", "--el_createjcl", and "--el_createdbg" command-line options for ecc32/emake to inject JEDI/JCL debug info, create .jdbg file, and create .dbg file (Microsoft debug format...

    在Java中获取系统属性.doc

    InputStream input = new FileInputStream("config.properties"); // 加载属性文件 prop.load(input); // 获取属性值 String logLevel = prop.getProperty("log.level"); String dbUrl = prop.getProperty(...

    spring-framework-reference-4.1.2

    Using Log4J ............................................................................................. 14 II. What’s New in Spring Framework 4.x ......................................................

    spark在虚拟机的安装

    在`$SPARK_HOME/conf/log4j.properties`文件中配置日志级别,避免过多的日志输出影响性能。 #### 五、基本操作 1. **创建测试目录** 创建用于测试的目录,例如`mkdir ~/wordcount/input`。 2. **复制LICENSE....

    操作excel库downkr.com_LibXL

    Project -> Properties -> Linker -> Input -> Additional Dependencies - copy bin\libxl.dll to directory of your project 2. MinGW Type in examples/c++/mingw directory: g++ generate.cpp -o ...

    ZendFramework中文文档

    1. Introduction to Zend Framework 1.1. 概述 1.2. 安装 2. Zend_Acl 2.1. 简介 2.1.1. 关于资源(Resource) 2.1.2. 关于角色(Role) 2.1.3. 创建访问控制列表(ACL) 2.1.4. 注册角色(Role) 2.1.5. 定义访问...

    微软内部资料-SQL性能优化2

    Those pages may however have to be faulted in from a page file or memory mapped file. Backing Store Backing store is the physical representation of a memory address. Page Fault (Soft/Hard) A ...

    Javaweb课程作业基于Hadoop的中文词频统计工具源码+使用说明.zip

    5、将Linux里配置好的hadoop的配置文件目录里的log4j.properties和core-site.xml复制到项目根目录(IDEA的maven项目的话是放到resources目录里,下同) 6、往HDFS里/user/joe/wordcount/input传要统计的文件(不要...

    Velocity配置文件详解

    - **input.encoding**:模板输入的字符编码,默认为ISO-8859-1。 - **output.encoding**:模板输出的字符编码,默认也为ISO-8859-1。这两个配置项对于确保正确处理不同语言和字符集的文本非常重要。 ##### 2.2 ...

    UE(官方下载)

    Monitor log files and more using UltraEdit's file change polling feature Vertically split the edit window Splitting the edit window in UltraEdit/UEStudio Large file text editor UltraEdit can be used ...

Global site tag (gtag.js) - Google Analytics