Git Product home page Git Product logo

dropwizard-logging-loggly's Introduction

Dropwizard Logging Loggly

A log appender factory for Dropwizard adding support for appending logs to Loggly

Build Status Maven Central

dropwizard-logging-loggly can be found in maven central.

Installation

<dependency>
    <groupId>com.jamierf.dropwizard</groupId>
    <artifactId>dropwizard-logging-loggly</artifactId>
    <version>...</version>
</dependency>

Configuration

logging:
  appenders:
    - type: loggly
      token: "..."
      tag: "example-prod" # optional

Change Log

0.7 - 19 January 2016

  • Support for Dropwizard 0.9.x.
  • Use ISO 8601 format for timestamps.

0.6 - 12 January 2015

  • Send logs in Json format rather than plain.

0.5 - 18 October 2014

  • Added (optional) tag configuration parameter.

0.4 - 28 September 2014

  • Initial release.

License

Released under the Apache 2.0 License.

dropwizard-logging-loggly's People

Contributors

gauravspatel avatar reines avatar supercargo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dropwizard-logging-loggly's Issues

raw timestamps not parsed by loggly

With the default JsonLayout the timestamp is output as time-since-epoch, but Loggly only parses ISO 8601 timestamps in JSON formatted logs (see https://www.loggly.com/docs/automated-parsing/#json). This results in the following notification within loggly on logs sent through dropwizard-logging-loggly:

message: Could not parse timestamp field from event. Using reception time as timestamp.
type: InvalidTimestamp

Optional logging.appenders[0].tag Has Multiple Matching Constraint Validators

I'm trying to use dropwizard-logging-loggly:0.6 with dropwizard-core:0.9.1, and I can't get my server to start. Here's my config:

logging:
    level: INFO
    appenders:
        - type: loggly
          token: "..."

When I try to start the application, I get this error:

Exception in thread "main" javax.validation.UnexpectedTypeException: HV000186: The constraint of type 'javax.validation.constraints.NotNull' defined on 'logging.appenders[0].tag' has multiple matching constraint validators which is due to an additional value handler of type 'io.dropwizard.validation.valuehandling.OptionalValidatedValueUnwrapper'. It is unclear which value needs validating. Clarify configuration via @UnwrapValidatedValue.
    at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getConstraintValidatorInstanceForAutomaticUnwrapping(ConstraintTree.java:266)
    at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.getInitializedConstraintValidator(ConstraintTree.java:163)
    at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:116)
    at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:87)
    at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:73)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateMetaConstraint(ValidatorImpl.java:592)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:555)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:490)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:454)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:406)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:770)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:656)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:415)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:770)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:656)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:415)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:204)
    at io.dropwizard.configuration.ConfigurationFactory.validate(ConfigurationFactory.java:257)
    at io.dropwizard.configuration.ConfigurationFactory.build(ConfigurationFactory.java:149)
    at io.dropwizard.configuration.ConfigurationFactory.build(ConfigurationFactory.java:95)
    at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:115)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:64)
    at io.dropwizard.cli.Cli.run(Cli.java:70)
    at io.dropwizard.Application.run(Application.java:80)
    at com.aeryon.live.WebServiceApplication.main(WebServiceApplication.java:40)

The issue appears to be with the combination of the @NotNull annotation and the Optional type on line 78 of LogglyAppenderFactory.class, but I'm quite new to Dropwizard so I can't say for sure.

NullPointerException thrown on v0.8.4

Using dropwizard 0.8.4 in an integration test, when including this in the config.yml file:

logging:
  appenders:
    - type: loggly
      token: <token-here>
      tag: <tag-here>

With this maven dependency definition:

        <dependency>
            <groupId>com.jamierf.dropwizard</groupId>
            <artifactId>dropwizard-logging-loggly</artifactId>
            <version>0.7</version>
        </dependency>

This error is thrown on startup:

java.lang.NullPointerException
    at io.dropwizard.validation.valuehandling.OptionalValidatedValueUnwrapper.getValidatedValueType(OptionalValidatedValueUnwrapper.java:27)
    at org.hibernate.validator.internal.engine.ValueContext.getTypeOfAnnotatedElement(ValueContext.java:192)
    at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:125)
    at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateComposingConstraints(ConstraintTree.java:233)
    at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:102)
    at org.hibernate.validator.internal.engine.constraintvalidation.ConstraintTree.validateConstraints(ConstraintTree.java:91)
    at org.hibernate.validator.internal.metadata.core.MetaConstraint.validateConstraint(MetaConstraint.java:83)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraint(ValidatorImpl.java:547)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForDefaultGroup(ValidatorImpl.java:487)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateConstraintsForCurrentGroup(ValidatorImpl.java:451)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:403)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:617)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraint(ValidatorImpl.java:723)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateCascadedConstraints(ValidatorImpl.java:601)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validateInContext(ValidatorImpl.java:412)
    at org.hibernate.validator.internal.engine.ValidatorImpl.validate(ValidatorImpl.java:206)
    at io.dropwizard.configuration.ConfigurationFactory.validate(ConfigurationFactory.java:253)
    at io.dropwizard.configuration.ConfigurationFactory.build(ConfigurationFactory.java:142)
    at io.dropwizard.configuration.ConfigurationFactory.build(ConfigurationFactory.java:88)
    at io.dropwizard.cli.ConfiguredCommand.parseConfiguration(ConfiguredCommand.java:114)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:63)
    at io.dropwizard.testing.DropwizardTestSupport.startIfRequired(DropwizardTestSupport.java:143)
    at io.dropwizard.testing.DropwizardTestSupport.before(DropwizardTestSupport.java:71)
    at io.dropwizard.testing.junit.DropwizardAppRule.before(DropwizardAppRule.java:66)
    at org.junit.rules.ExternalResource$1.evaluate(ExternalResource.java:46)
    at org.junit.rules.RunRules.evaluate(RunRules.java:20)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
    at org.junit.runner.JUnitCore.run(JUnitCore.java:137)

Dropwizard 1.0.0

There seems to be some issue in the latest release of Dropwizard

The following exception is always thrown on startup

Exception in thread "main" java.lang.AbstractMethodError
    at io.dropwizard.logging.DefaultLoggingFactory.configure(DefaultLoggingFactory.java:134)
    at io.dropwizard.cli.ConfiguredCommand.run(ConfiguredCommand.java:81)
    at io.dropwizard.cli.Cli.run(Cli.java:75)
    at io.dropwizard.Application.run(Application.java:79)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.