简体   繁体   English

Java日志记录框架,该框架运行在1.1.8 / 1.2的子集上,并且不依赖于java.beans等(如log4j那样)

[英]Java logging framework which runs on a subset of 1.1.8/1.2 and does not depend on java.beans, etc (as log4j does)

I'm working on an application for a device which supports a subset of Java 1.1.8/1.2, specifically the classes in the following packages: 我正在为支持Java 1.1.8 / 1.2的子集的设备开发应用程序,尤其是以下软件包中的类:

  • java.lang java.lang
  • java.io java.io
  • java.util java.util
  • java.net java.net
  • java.lang.reflect java.lang.reflect
  • java.util.zip java.util.zip
  • java.math java.math
  • java.text java.text
  • java.security java.security

I want to include quite a bit of logging in this application to make troubleshooting and support easier. 我想在此应用程序中包含很多日志,以使故障排除和支持更加容易。

Ideally I would use log4j, but even the version of log4j which supports SDK 1.1.8 requires java.beans among other things. 理想情况下,我将使用log4j,但是即使支持SDK 1.1.8的log4j版本也需要java.beans。

Is there another logging framework which has fewer dependencies, or am I stuck rolling my own? 是否有另一个依赖关系较少的日志记录框架,还是我坚持自己滚动?

My plan is to log to disk which means that a feature like log4j's RollingFileAppender would be useful for keeping the logs a reasonable size, but all in all I'm not too picky about features as long as it beats rolling my own (which I will end up doing if I have to). 我的计划是登录到磁盘,这意味着log4j的RollingFileAppender之类的功能对于保持日志的合理大小很有用,但是总的来说,我对功能的选择并不挑剔,只要它能胜过自己滚动(我会最后必须做的事情)。


I found the following frameworks, but none of them will work on my device. 我找到了以下框架,但它们都无法在我的设备上运行。

  • simple-log : Requires 1.4 simple-log :需要1.4
  • MicroLog : Java ME MicroLog :Java ME
  • Java Logging Framework : Unavailable classes Java Logging Framework :不可用的类
  • Java Logging Suite : This might actually work if I do not use the threadsafe logger (which uses Collections.synchronizedList from java.util), but it's basic enough and there are enough differences in my needs that I think I'll be better off rolling my own. Java Logging Suite :如果我不使用线程安全记录器(它使用java.util中的Collections.synchronizedList),这实际上可能起作用,但是它足够基本,我的需求也有足够的差异,我认为我会更好我自己的。

您说您有java.util,所以您有java.util.logging吗?

我们无法找到合适的框架来编写自己的简单框架。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM