You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by David Leangen <ap...@leangen.net> on 2020/06/13 13:18:33 UTC

Logging warning

Hi!

For the documentation, I have been trying to run the “Local” server [1].

[1] https://james.leangen.net/main/3.5/servers/index.html#local

When attempting to use the CLI, I encounter this warning:

```
listDomains
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
SLF4J: Defaulting to no-operation MDCAdapter implementation.
SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
9358a5658e40
james.linagora.com
localhost
192.168.80.2
ListDomains command executed sucessfully in 572 ms.
```

According to the documentation at the url in the error message:

> Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.


I tried including logback-classic.jar in the james-server-cli.lib directory (and verified in the Docker image that it was indeed there), but unfortunately that did not solve the problem.

Any ideas as to what I should do?


Thanks,
=David



Re: Logging warning

Posted by Eugen Stan <eu...@netdava.com>.
Hi,

> The only detail is that in that specific case, we are actually talking
> about the CLI tool: we don't really expect a use to choose the logging
> library for his CLI.
>
> And the error is about providing none.
>
> We can just include a Noop implementation to shut down the warning IMO.
>
> -- Matthieu Baechler

I did not catch the talk about the CLI. Thanks.

Since we are talking about an application and not a library, it makes
sense to put an implementation.

The no-opp would be ok I guess.

Let's hope it does not swallow important information.

There are some good practices when logging from CLI's but I'm not very
up to date on them.

When I build CLI's I try to implement the --verbose option and use that
flag to spit out logging usually to the console.

-- 
Eugen Stan
+40720 898 747 / netdava.com


Re: Logging warning

Posted by Matthieu Baechler <ma...@apache.org>.
Hi Eugen,

On Mon, 2020-06-15 at 11:13 +0300, Eugen Stan wrote:
> Hi,
> 
> Removing the implementation leak a MUST.
> 
> As I've mentioned in the issue/mail, logging implementation is a
> deployment decision.

I agree

> We should provide documentation and make it easy for people to
> switch.
> In a "product like" distribution we will deliver an implementation
> suitable for that use case.

I agree on all that, too.

> Libraries should NOT depend on an logging implementation.
> 
> Add the logging implementation to the test scope if needed.

What is done in the source code for now. We use slf4j facade
everywhere.

> 
> == The rationale
> 
> Some people log to memory
> 
> Some people log to (rotating) files
> 
> Some people log to local (on the same host) log aggregator
> 
> Some people log to a central, over the network logging collector.
> 
> 
> Every use case is valid - it depends on the decisions made when the
> infrastructure was built.
> 
> We can't know in advance what users will use.

The only detail is that in that specific case, we are actually talking
about the CLI tool: we don't really expect a use to choose the logging
library for his CLI.

And the error is about providing none.

We can just include a Noop implementation to shut down the warning IMO.

-- Matthieu Baechler


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Re: Logging warning

Posted by Eugen Stan <eu...@netdava.com>.
Hi,

Removing the implementation leak a MUST.

As I've mentioned in the issue/mail, logging implementation is a
deployment decision.

We should provide documentation and make it easy for people to switch.

In a "product like" distribution we will deliver an implementation
suitable for that use case.

Libraries should NOT depend on an logging implementation.

Add the logging implementation to the test scope if needed.


== The rationale

Some people log to memory

Some people log to (rotating) files

Some people log to local (on the same host) log aggregator

Some people log to a central, over the network logging collector.


Every use case is valid - it depends on the decisions made when the
infrastructure was built.

We can't know in advance what users will use.


La 15.06.2020 08:09, David Leangen a scris:
>>> When attempting to use the CLI, I encounter this warning:
>> Very likely we have 2 logging dependencies on the classpath.
>>
>> This needs to be rationalised. I will add this to JAMES-3214 as this
>> relates to cleaning dependency mess…
>
> Perfect, thank you!
>
>
-- 
Eugen Stan
+40720 898 747 / netdava.com


Re: Logging warning

Posted by David Leangen <ap...@leangen.net>.
>> When attempting to use the CLI, I encounter this warning:

> Very likely we have 2 logging dependencies on the classpath.
> 
> This needs to be rationalised. I will add this to JAMES-3214 as this
> relates to cleaning dependency mess…


Perfect, thank you!



Re: Logging warning

Posted by Tellier Benoit <bt...@apache.org>.
Very likely we have 2 logging dependencies on the classpath.

This needs to be rationalised. I will add this to JAMES-3214 as this
relates to cleaning dependency mess...

Cheers,

Benoit

Le 13/06/2020 à 20:18, David Leangen a écrit :
> 
> Hi!
> 
> For the documentation, I have been trying to run the “Local” server [1].
> 
> [1] https://james.leangen.net/main/3.5/servers/index.html#local
> 
> When attempting to use the CLI, I encounter this warning:
> 
> ```
> listDomains
> SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
> SLF4J: Defaulting to no-operation (NOP) logger implementation
> SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
> SLF4J: Failed to load class "org.slf4j.impl.StaticMDCBinder".
> SLF4J: Defaulting to no-operation MDCAdapter implementation.
> SLF4J: See http://www.slf4j.org/codes.html#no_static_mdc_binder for further details.
> 9358a5658e40
> james.linagora.com
> localhost
> 192.168.80.2
> ListDomains command executed sucessfully in 572 ms.
> ```
> 
> According to the documentation at the url in the error message:
> 
>> Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar on the class path should solve the problem.
> 
> 
> I tried including logback-classic.jar in the james-server-cli.lib directory (and verified in the Docker image that it was indeed there), but unfortunately that did not solve the problem.
> 
> Any ideas as to what I should do?
> 
> 
> Thanks,
> =David
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org