Log4j-寻找良好的“入门"教程或博客 [英] Log4j - Looking for a good 'Getting started' tutorial or blog

查看:43
本文介绍了Log4j-寻找良好的“入门"教程或博客的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天下载了Log4j版本1.2.16.我想在一个简单的Java控制台应用程序中启用日志记录.我正在寻找一个快速入门"教程或博客,以使我能够使用一些不错的代码示例执行文件记录.

I downloaded Log4j version 1.2.16 today. I want to enable logging in a simple java console application. I'm looking for a 'quick start' tutorial or blog that allows me to perform file logging with some good code samples.

推荐答案

log4j 是log4j的完美起点.

The short introduction to log4j is a perfectly fine starting point for log4j.

如果您准备花钱,可以购买 log4j手册

If you're ready to spend some money, you can buy the log4j manual.

顺便说一句,如果您不熟悉Java登录,建议您 slf4j + logback 组合.我认为,这是最好的日志记录解决方案. Slf4j是一个日志外观",它需要在下面实现. Log4j和logback可用作实现.

By the way, if you're new to logging in Java, I'd suggest the slf4j + logback combo. In my opinion, this is the best logging solution available. Slf4j is a logging "facade" and it needs an implementation underneath. Log4j and logback can be used as implementations.

由于logback是log4j的后继者,并且由同一位作者完成,因此建议您改用它.不仅如此,在线可以免费获得logback的手册.

Since logback is log4j's successor and made by the same author, I'd suggest using it instead. Not only that, logback's manual is available online and it's free.

由于log4j的开发或多或少地陷入了停滞,我建议您升级到slf4j + logback.

Since log4j's development has more or less stalled, I'd suggest you upgrade to slf4j + logback.

这篇关于Log4j-寻找良好的“入门"教程或博客的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆