log4erl Configuration

https://github.com/ahmednawras/log4erl/blob/master/CONFIGURATION.txt

Configuration Guide:
====================

TOC:
====
* Introduction
* Loggers
- Example
* Appenders
- common properties
- file_appender
- console_appender
- smtp_appender
- syslog_appender

Introduction:
=============
This document explains the format of log4erl configuarion file. The configuration file is simple
and easy to write. At any place in the file, any thing you type after ‘%‘ is a comment.
You can find a sample configuration in the file ‘log4erl.conf‘ under ‘priv‘ directory.

* Loggers:
==========
It contains a list of logs with the format below, where
<name> is any name you‘d like to call it. <name> can later on be used with any of the log messages
in log4erl API (e.g. log4erl:info/2,3,4). If no value for <name> exists or value of "default" suplied,
then the elements inside ‘{‘ and ‘}‘ will be applied to the default logger.

logger [<name>] {
...
}

Example:
--------
logger application_logger{
...
}

%% default logger
logger {
...
}

* Appenders:
============
Inside each logger, there can be 1 or more appenders. These appenders can be
added inside loggers according to the format below.

<appender_type> <name> {
...
}

Example:
--------
file_appender file1{
...
}

insider appenders‘ block, you can add properties for that appender in the format ‘property=value‘.
Multiple properties are seperated by a comman ‘,‘Each appender type has different sets of properties,
which are detailed below.

common properties:
------------------
level = <Level> => level of log (e.g. warn)
format = <F> => format of the output (look at ‘Appenders.txt‘)

file_appender:
--------------
dir = <Dir> => directory of output (e.g. /var/log/my_app)
file = <File> => name of the log file (e.g. my_app_log)
type = <Type> => either size or time. Only size is implemented currently
max = <Max> => Maximum size of each rotation
suffix = <Suf> => Suffix of the log file (e.g. log)
rotation = <R> => number of rotations before over-writing log files

console_appender:
-----------------
Nothing more than common properties.

smtp_appender:
--------------
ip = <IP> => ip of the SMTP server
port = <Port> => SMTP prot [Optional]
no_auth = true|false => if specified, no authentication is performed even if
username or password below is provided
username = <U> => SMTP username
password = <P> => SMTP password
from = <From> => value of the From field [Optional]
to = <To> => email to send to
title = <T> => title of email [Optional]
msg = <Format> => format of the email message [Optional]

syslog_appender:
----------------
facility = <F> => Facility to be used (e.g. ftp)
host = <H> => Host to send syslog messages to [Optional]
port = <P> => syslog port [Optioanl]

时间: 2024-08-02 02:08:24

log4erl Configuration的相关文章

log4erl API

https://github.com/ahmednawras/log4erl/blob/master/API.txt NOTE:=====Please be informed that the API below as of now is not stable and any of the functions/parameters belowmay be changed without prior notice. Furthermore, you can find appenders and t

ubuntu开机出现waiting for network configuration

ubuntu启动时,出现waiting for network configuration,waiting up to 60 more seconds for network configuration等,进入桌面后网络图标也不见了 解决方法,首先在 /etc/network/interfaces 文件里面无关的都删去,留下lo这个 然后再到/etc/init/failsafe.conf文件里将sleep59改成5或10,sleep50意思是等待59秒

出现unmapped spring configuration files found

intell idea启动出现unmapped spring configuration files found提示. 把spring里面的内容都打勾.

Check if a configuration profile is installed on iOS

Configuration profiles can be downloaded to an iOS device through Safari to configure the device in a certain way. You can do things like force the user to set a passcode or set restrictions like not allowing them to install apps or not allowing acce

Apache Commons Configuration之一简介

1    简介 Commons Configuration软件类库提供通用配置接口,使Java应用程序从多种源读取配置文件.Commons Configuration提供简单类型访问和通过以下代码演示的多义配置参数: Double double = config.getDouble("number"); Integer integer = config.getInteger("number"); 配置参数可以从以下源加载: Properties文件 XML文档 Pr

System Center 2012 R2 CM系列之配置configuration manager防火墙设置

为了能够正常推送Configuration Manager 2012 R2客户端,必须添加防火墙例外设置,主要包括以下两个:A:文件和打印共享:B: Windows Management Instrumentation (WMI) 1. 打开并登录"BJ-DC-01"服务器,点击工具,打开组策略管理器 2. 右键相关域,点击创建"在这个域中创建GPO并在此处链接" 3. 新建GPO对话框中输入相应的GPO名称 4. 右键新创建的PGO,点击编辑,并打开组策略管理编辑

MyBatis框架中Mapper映射配置的使用及原理解析(三) 配置篇 Configuration

从上文<MyBatis框架中Mapper映射配置的使用及原理解析(二) 配置篇 SqlSessionFactoryBuilder,XMLConfigBuilder> 我们知道XMLConfigBuilder调用parse()方法解析Mybatis配置文件,生成Configuration对象. Configuration类主要是用来存储对Mybatis的配置文件及mapper文件解析后的数据,Configuration对象会贯穿整个Mybatis的执行流程,为Mybatis的执行过程提供必要的配

setup界面的network configuration 进不去的原因

setup界面的network configuration 进不去的原因 这个问题在百度上搜了好久都没搜到能解决的答案,最后还是自己琢磨出来的. 目前我遇进不去的原因是,因为在刚装好系统(装的是最小化的)后直接暴力装的system-config-network-tui,导致缺少依赖包,造成了点不进去. 解决办法: rpm-qa | grep 'system-config-network-tui' 查看所有安装包并过滤出网络安装包            rpm-e system-config-ne

Spring - Java Based Configuration

So far you have seen how we configure Spring beans using XML configuration file. If you are comfortable with XML configuration, then it is really not required to learn how to proceed with Java-based configuration as you are going to achieve the same