Projects tagged ‘java’ and ‘log’


[27 total ]

659 Users
   

log4j is a Java-based logging utility, and is one of many projects from the Apache Software Foundation. It is used primarily as a debugging tool.
Created over 3 years ago.

1 Users

OverviewMinLog is a Java logging library. Key features: Low overhead Logging statements below a given level can be automatically removed by javac at compile time. Simple and efficient The API is ... [More] concise and very efficient at runtime. Extremely lightweight The entire project consists of one Java file with just over 100 non-comment lines of code. The JAR is 2.6kb (2kb with pack200). UsageMessages are logged using static methods: Log.info("Some message."); Log.debug("Error reading file: " + file, ex);A static import can be used to make the logging more concise: import static com.esotericsoftware.minlog.Log.*; // ... info("Some message."); debug("Error reading file: " + file, ex);While optional, for brevity the rest of this documentation assumes this static import is in place. If log statements from different libraries or areas of an application need to be differentiated, a category can be specified: info("some lib", "Some message."); debug("some lib", "Error reading file: " + file, ex);Log levelSetting the level will log that level, as well as all higher levels: Log.set(LEVEL_INFO);The levels are: LEVEL_NONE disables all logging. LEVEL_ERROR is for critical errors. The application may no longer work correctly. LEVEL_WARN is for important warnings. The application will continue to work correctly. LEVEL_INFO is for informative messages. Typically used for deployment. LEVEL_DEBUG is for debug messages. This level is useful during development. LEVEL_TRACE is for trace messages. A lot of information is logged, so this level is usually only needed when debugging a problem. Conditional loggingThe current log level can be checked before the message is logged: if (ERROR) error("Error reading file: " + file, ex); if (TRACE) { StringBuilder builder = new StringBuilder(); // Do work, append to the builder. trace(builder); }Checking the log level before calling the logging method is optional, but prevents unnecessary method calls and string concatenation for log levels that are disabled. Fixed logging levelsMinLog users can choose from the regular "minlog.jar" or from from a JAR file like "minlog-info.jar" which has a fixed logging level that cannot be changed at runtime (calls to Log.set() have no affect). During compilation, any conditional logging statements below the fixed level will be automatically optimized away by the Java compiler. Please see OverheadAndComparisons for more about the overhead when using MinLog with/without conditional logging and with/without a fixed logging level. The document also compares the MinLog overhead with log4j and java.util.logging. Output customizationThe default logger outputs messages in this format: time level: [category] messageWhere "time" is the time elapsed since the application started. For example: 00:00 TRACE: [kryo] Wrote string: moo 00:00 TRACE: [kryo] Wrote object: NonNullTestClass 00:01 TRACE: [kryo] Wrote string: this is some data 00:01 TRACE: [kryo] Compressed to 7.97% using: DeflateCompressor 00:12 TRACE: [kryo] Decompressed using: DeflateCompressor 00:12 TRACE: [kryo] Read string: this is some dataThe output can be customized: static public class MyLogger extends Logger { public void log (int level, String category, String message, Throwable ex) { StringBuilder builder = new StringBuilder(256); builder.append(new Date()); builder.append(' '); builder.append(level); builder.append('['); builder.append(category); builder.append("] "); builder.append(message); if (ex != null) { StringWriter writer = new StringWriter(256); ex.printStackTrace(new PrintWriter(writer)); builder.append('\n'); builder.append(writer.toString().trim()); } System.out.println(builder); } } // ... Log.set(new MyLogger());Using this mechanism, log messages can be filtered (eg, by category), written to a file, etc. [Less]
Created 2 months ago.

0 Users

Log FacadeSupports printf style message format for performance and ease of use and extends log4j logging api with Java 5 var args. See excerpt from the Log interface below. public interface Log { ... [More] void debug(String message); void debug(Throwable t, String message); void debug(String message, Object... params); void debug(Throwable t, String message, Object... params); boolean isDebugEnabled(); ... }See the documentation for more information. [Less]
Created 12 months ago.

0 Users

This software is a prototype of final design from the students of Computer Science and Information Systems, which is under development. The software aims to offer ways of reading log files, that are ... [More] made based on Log4J API settings and display the information in web interface. [Less]
Created 4 months ago.

0 Users

When processing huge logfiles (most of real-world logs are huge) people usually have to resort to unix text utilities like grep, awk etc. They are great but they do not offer any interactivity and ... [More] require hackery to do non-trivial things, let alone do any visualizations. This project aims to fill this gap. The main goals are: Capability to process log files of unlimited size that leave no hope of reading them into memory Extensibility in terms of log format: the details of particular formats should be responsibilities of plugins Extensibility in terms of analyses and visualizations: the program core should be a compact and efficient API for access to log files plus a plugin infrastructure, and everything else should be pluggable Extensibility in terms of input sources: it should be possible to process logs from simple files, from concatenations of gzipped files, from sockets and from anything else [Less]
Created 2 months ago.

0 Users

Created about 1 year ago.

0 Users

Viewer to show text files without loading the whole content in memory. DescriptionThe project will provide: an indexer that scans the text file and creates an index mapping line numbers to file ... [More] positions. a model of the file content. The model uses the indexer to provide methods to access the file content on a line basis. an eclipse text viewer (using a simple SWT StyledWidget) which uses the model to retrieve the text to be displayed. Update siteUse the following URL as update site http://largefileviewer.googlecode.com/svn/trunk/speedyviewer-update-site [Less]
Created 12 months ago.

0 Users

An implementation of a rfc3164 syslog daemon. (21-07-08) Uploaded not yet finished source. (04-08-08) Uploaded a running version. Also added a small build.xml. Parsing is still far from perfect. ... [More] syslogd will die if incoming message is malformed. [Less]
Created 12 months ago.

0 Users

Library has customizeable architecture. Default implementation uses java reflection api to retrieve object's fields, dom4j for transforming this data to writeable form (XML), and log4j to log the ... [More] data. Library usage is 3 lines of code, actually: getFactory() factory.getDump() or factory.getDump(Class cl) (done to provide correct logging via log4j) dump.dump(object); [Less]
Created 12 months ago.

0 Users

Simple web application for gathering log from other applications trough a simple installed client.
Created about 1 year ago.