ActiveCampaign/postmark-java

Log4j.properties

corrspt opened this issue · 6 comments

Hi

I'm having an issue after adding postmark to my app. I'm using the Play Framework v.2.6.x (which uses Logback for logging by default).

After I added postmark to my app, I started getting lots of log information from several libraries that are used in the app (debug info mostly). I if remove postmark, the problem goes way.

I've been able to silence the log, by adding my own log4.properties to override the one that comes in postmark. But I don't use log4j directly, so that file is only there to silence what postmark brings.

Is this really necessary? or is there a way around it?

Thanks

Hi

I will need to check if there is other way for silencing logs. They are probably coming from libraries being used within Postmark library (Jersey, Jackson).

Will let you know
Igor

Hi Igor, thanks for pitching in.

Now that you mention that situation of other libraries, there's another issue I had while adding postmark to my app. I got the SLF4J Multiple Bindings Found warning (https://www.slf4j.org/codes.html#multiple_bindings)

I narrowed it down to the mime-util library that comes via pom.xml with Postmark

        <dependency>
            <groupId>eu.medsea.mimeutil</groupId>
            <artifactId>mime-util</artifactId>
            <version>2.1.3</version>
        </dependency>

In order to solve it I had to exclude the transitive dependency on slf4j-log4 that mime-util has:
Sample code from my build.sbt

excludeDependencies += "org.slf4j" % "slf4j-log4j12"
excludeDependencies += "org.log4j" % "log4j"

Hey

gotcha, thanks for reporting that one. I noticed that one too for mimeutil used for easy attachments addition.

Will check that one out, with other logs

Igor

Hi

I made a change to logging so that by default it should be turned off for the library and added debug mode. The update should have been part of one other update later next month, but could not wait so released this now :)

Let me know if this will silence the loggings. By default they were set to debug mode, which explains why you saw all of them.

I think that did it, I've updated the library and deleted my log4.properties and logs seem to be fine. Thanks :)

Hey! nice!

you are welcome :)

Igor