您好,欢迎光临本网站![请登录][注册会员]  
文件名称: erlang日志应用log4erl(非sasl)
  所属分类: 其它
  开发工具:
  文件大小: 145kb
  下载次数: 0
  上传时间: 2014-09-03
  提 供 者: u0105*****
 详细说明: 用不惯sasl的,可以用log4xxx的erlang版,log4erl。 log4erl Manual: =============== TOC: ==== 1. Features 2. Installation 3. Usage 4. API 5. Configuration 6. Known issues 7. Future development 8. License 1. FEATURES: ============ - Multiple logs - Currently, only size-based log rotation of files for file appender - Support default logger if no logger specified - 5 predifined log levels (debug, info, warn, error, fatal) - A log handler for error_logger - Support for user-specified log levels - 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 of appender during run-time 2. INSTALLATION: ================ To compile & install log4erl, download source from google code's website (http://code.google.com/p/log4erl/) or from svn: $> svn checkout http://log4erl.googlecode.com/svn/trunk/ log4erl or from github public repository (http://github.com/ahmednawras/log4erl/). $> cd log4erl $> make or you can run the below from erlang shell: $> cd src $> erl 1> make:all([{outdir, "../ebin"}]). 3. USAGE: ========= 1- In order to use log4erl, you need to first include it in the path. There are 2 ways to do this: a) include the "log4erl" directory in erlang's "lib" directory in the target machine (cp -Rf log4erl /where/erlang/is/lib). $> cp -Rf log4erl /usr/local/lib/erlang/lib/ b) include the "log4erl" ebin directory in the path when running you program $> erl -pz /path/to/log4erl ... 2- Once the log4erl directory is included, you can use its API as described in section "API". but before, you need to run: > application:start(log4erl). 3- Create a configuration file and load it using log4erl:conf(File) > log4erl:conf("priv/log4erl.conf"). 4- Alternatevly, you can create loggers & add appenders to them programmatically as appropriate. You can do this as per the API below. > log4erl:add_logger(messages_log). > log4erl:add_console_appender(messages_log, cmd_logs, {warn, "[%L] %l%n"}). where Conf is the erlang term describing how the log is to be handled You can also add more types of appenders, which is explained in API.txt and Appneders_API.txt. 5- Now, you can log whatever messages you like as per logging functions described in API. > log4erl:info("Information message"). Precedance of log levels are: all = debug < info < warn < error < fatal < none User defined levels are always written except when none level is specified in the logger specification (See below). 4. API: ======= Please look at API.txt file for more information about the API. 5. CONFIGURATION: ================= Please look at CONFIGURATION.txt for more information about how to configure log4erl. 6. KNOWN ISSUES: ================ - Name of both loggers & appenders should be unique and not registered since log4erl will try and register their names. If the name is already registered, nothing will happen. This will be fixed soon. - If you run change_log_format/1,2 and appender crashed, a restart from the supervisor will not record the latest format used. It will only use either the default format or the format used in the argument is supplied. 7. FUTURE DEVELOPMENT: ====================== - Add support for different log persistance methods (e.g files, XML, console, DB, SNMP, syslog...etc) - Add support for time-based log rotation - Multiple configuration format (Erlang terms, XML?, properties files?) - Add support for NDC & MDC ??? Please send your suggestion to ahmed.nawras gmail com 8. LICENSE: =========== This software is subject to "Mozilla Public License 1.1". You can find the license terms in the file 'LICENSE.txt' shipping along with the source code. You may also get a copy of the license term from the URL: "http://www.mozilla.org/MPL/MPL-1.1.html". ...展开收缩
(系统自动生成,下载前可以参看下载内容)

下载文件列表

相关说明

  • 本站资源为会员上传分享交流与学习,如有侵犯您的权益,请联系我们删除.
  • 本站是交换下载平台,提供交流渠道,下载内容来自于网络,除下载问题外,其它问题请自行百度
  • 本站已设置防盗链,请勿用迅雷、QQ旋风等多线程下载软件下载资源,下载后用WinRAR最新版进行解压.
  • 如果您发现内容无法下载,请稍后再次尝试;或者到消费记录里找到下载记录反馈给我们.
  • 下载后发现下载的内容跟说明不相乎,请到消费记录里找到下载记录反馈给我们,经确认后退回积分.
  • 如下载前有疑问,可以通过点击"提供者"的名字,查看对方的联系方式,联系对方咨询.
 相关搜索: erlang log sasl
 输入关键字,在本站1000多万海量源码库中尽情搜索: