Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-331

“ERROR Failed to write log event to MongoDB due to invalid result [0]” when using NoSQLAppender

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.0-beta8
    • 2.0-beta9
    • Appenders
    • None
    • JDK 1.7, Mongo Driver 2.11.2

    Description

      I get following message

      ERROR Failed to write log event to MongoDB due to invalid result [0]

      when using NoSQLAppender with log4j2 v2.0-beta8 but log event gets written to MongoDB.

      Here is my config

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration status="WARN">
      <appenders>
      <NoSql name="databaseAppender" suppressExceptions="true">
      <MongoDb collectionName="applicationLog" factoryClassName="com.borsch.DBManager" factoryMethodName="getNewMongoClient" writeConcernConstant="NONE" username="root" password="qwe"/>
      </NoSql>
      </appenders>
      <loggers>
      <root level="error">
      <appender-ref ref="databaseAppender"/>
      </root>
      </loggers>
      </configuration>

      What's even more strange I can't find the code that generates it. I didn't find such string in sources of log4j2.

      Attachments

        Activity

          People

            beamerblvd Nick Williams
            expert expert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: