Log4j 2
  1. Log4j 2
  2. LOG4J2-229

New JDBC, JPA, and NoSQL database Appenders

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0-beta5
    • Fix Version/s: 2.0-beta8
    • Component/s: Appenders, Core
    • Labels:
      None

      Description

      As discussed on the mailing list ([1] and [2]), Log4j 2 is in need of some database appenders. I have added this new feature and will attach a patch shortly. The patch contains:

      • A slight change to PatternLayout. Currently it is not possible to create a PatternLayout that doesn't always handle exceptions. If you leave all exception handling out of the pattern, an exception handler is forcibly added to the end of the pattern. This behavior is controlled by a flag, but that flag is always hard-coded to false. I added a parameter for it. This was necessary for the JDBC appender.
      • o.a.l.l.core.appender.db.AbstractDatabaseManager and AbstractDatabaseAppender, together in concert, take care of some core functionality common across all database appenders, such as buffering and connection state.
      • o.a.l.l.core.appender.db.jdbc.JDBCAppender (and Manager, other classes) supports writing events to a relational database using raw JDBC. It's injection-safe due to the use of prepared statements. It can be configured with URL/username/password, JNDI data source, or a connection factory method.
      • o.a.l.l.core.appender.db.jpa.JPAAppender (and Manager, other classes) supports writing events to a relational database using the Java Persistence API version 2.0.
      • o.a.l.l.core.appender.db.nosql.NoSQLAppender (and Manager, other classes) supports writing to an abstract concept of a NoSQL provider. Providers have been created for MongoDB and Apache CouchDB. Creating a new provider is extremely easy.
      • Thorough unit tests for the abstract classes, the JDBC and JPA appenders, and the abstract parts of the NoSQLAppender. Directly unit testing the MongoDB and CouchDB providers in a platform-independent way is not easy and may not be possible.
      • Thorough documentation (both JavaDoc and Site documentation) for all of the appenders.

      [1] http://markmail.org/thread/z2wpmwelv7p6xh2o
      [2] http://markmail.org/thread/s7pljqdjhjz5xfk5

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Nick Williams
            Reporter:
            Nick Williams
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 168h
              168h
              Remaining:
              Remaining Estimate - 168h
              168h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development