Microlog

Microlog is a small, yet powerful logging library for mobile devices based on the Log4j API. Supports Java ME (J2ME) and Android. Logs to device, to PC or to servers online. Used in all phases from development on emulator/device to outdoor field-testing.

Microlog is licensed under The Apache Software License, Version 2.0 so it is possible to link and distribute commercial software with this library.

What Developers say about Microlog

  • "Nice little package you did. Very good and useful!" - B Hamanov
  • "Thanks for a great framework!" - M de Beer
  • "...don't stop working on Microlog - there is definitely a need for it within the J2ME community." - J Laursen

Features/benefits

  • Easy to setup. Configuration via the application descriptor, dependency injection or a property file.
  • Similar to Log4j, but built from scratch.
  • Small
  • Fast
  • Many different Appenders
    • ConsoleAppender - Appends to the console, e.g. System.out.
    • RecordStoreAppender - Appends to the RecordStore.
    • FileAppender - Appends to a file using a FileConnection.
    • CanvasAppender - Appends to a Canvas.
    • FormAppender - Appends to a Form.
    • BluetoothSerialAppender - Appends to a Bluetooth serial connection (btspp).
    • SerialAppender - Appends to a serial port (CommConnection).
    • SmsAppender - Appends to a cyclic buffer and send the buffer as an SMS.
    • MmsAppender (for MMS and/or e-mail) - Appends to a cyclic buffer and send the buffer as an SMS.
    • MemoryBufferAppender - Appends to a cyclic or a fixed buffer.
    • DatagramAppender - Appends to a datagram and send it using UDP.
    • SyslogAppender - Appends to syslog server.
    • SocketAppender - Appends to a socket connection (also SSL).
    • S3FileAppender - Appends to a file, as in the FileAppender, and stores the file on Amazon S3.
    • S3BufferAppender - Appends to a cyclic buffer and stores it as a file on Amazon S3.
  • Different Formatters for different needs
    • SimpleFormatter - Simple, fast and very small.
    • ConfigurableFormatter - A simple, but yet configurable formatter.
    • PatternFormatter - Decide exactly how you want to format your log messages. Inspired by the PatternLayout found in Log4j.
    • A lot of examples; there are 16 different MIDlet that show how you could use Microlog.
    • High quality. We use use these tools to ensure that Microlog has high quality:
      • Unit tests (JMUnit and Hammocks for Java ME combined with JUnit tests under Java SE)
      • Code checks (FindBugs & Lint4j)
      • Structure Checks (Structure 101)

Key usage examples

There are many scenarios when Microlog is usable. Thanks to the different Appenders & Formatters you could adopt to different situations. Here follows a list of scenarios and what to use in the different scenarios.

  1. Early development stage Use the ConsoleAppender and/or the RecordStoreAppender. Use the SimpleFormatter to start with. This makes it possible to run in the emulator and on the target device without any problems.
  2. Main development stage Use the BluetoothSerialAppender to easily transfer the log directly to your PC. The PatternFormatter should be used to create better logging output, e.g. the thread name.
  3. Field test by the developers Use the SyslogAppender class to log directly to a syslog server maintained by your team. The syslog daemon could be used to forward the logging messages, for example by sending e-mail.
  4. Beta/Early access tests Use the MMSAppender to send logs when something critical has happened, e.g. when a FATAL or ERROR message has been logged. This could be sent directly to your bug reporting system and/or some mailing list for your development team. Or you could use the S3FileAppender to log directly into your Amazon S3 account.

Projects that are using Microlog

Requirements

  • Java ME CLDC 1.1
  • Different appenders are depending on other libraries. Read the javadoc for each appender.

Contact

Please use the forums for bug reports, feature requests or questions about Microlog. Please contact us if you want to be listed as project that are using Microlog.

The Microlog team consists of:

  • Johan Karlsson - Founder, Developer & Project admin.
  • Darius Katz - Developer, Project admin & graphics artist
  • Karsten Ohme - Developer & Maven specialist
  • Henrik Larne - Developer
  • Mattias Arhursson - Developer
  • Jarle Hansen - Developer

Links