Re: More on logging

Daniel Dekany <[email protected]>
Newsgroups gmane.comp.web.freemarker.user
Message-ID <[email protected]>
Thursday, April 21, 2011, 7:01:40 PM, Chris wrote:

> We're trying to use SLF4j with Freemarker 2.3.16 and we're having a bit
> of trouble. I keep getting:
>
> log4j:WARN No appenders could be found for logger (freemarker.runtime).

(I have no experience with this error...)

> This is bizarre, because so far as I can tell, log4j isn't on the 
> classpath. We do have log4j-over-slf4j on the classpath, so maybe that's
> where it's coming from.

Exactly. After all the point of that jar is to mimic the presence of
Log4J.

> Logger.selectLoggerLibrary(Logger.LIBRARY_NONE) 
> seems to fix it, at least for now.
>
> In any case, I saw a thread on this list, July 25, 2010, that
> Logger.selectLoggerLibrary() would support slf4j in 2.3.17. That's
> cool, that will probably do the job.

If you are allowed to use a nightly releases, just use that:
http://freemarker.org:8085/download/FM-BRANCH23/artifacts/build-202/Library/freemarker.jar
I'm 99% that it's as stable as 2.3.16. Then use:

  Logger.selectLoggerLibrary(Logger.LIBRARY_SLF4J);

2.3.17 will be out in a few weeks, no mater how few new features it
will it contain.

> In the meantime, though, I'd like to urge you NOT to add
> commons-logging as an option to 2.3.17. Commons logging has enormous
> problems (which have been widely reported; a little googling will
> find them), and it's continuing headache to exclude commons logging
> from projects that are based on Maven. If you add a Maven dependency
> on commons logging to your POM, lots of people will have to do
> backflips to get rid of it. (For more on the problem, google
> "version 99 does not exist"). Just a suggestion.

FreeMarker 2.3 surely doesn't add *any* logging library as dependency
(except for building the freemarker.jar itself). In fact FreeMarker
has 0 required dependencies. Is it still a problem if FreeMarker
supports Commons Logging?

> Thanks. Looking forward to 2.3.17.

-- 
Best regards,
 Daniel Dekany


------------------------------------------------------------------------------
Fulfilling the Lean Software Promise
Lean software platforms are now widely adopted and the benefits have been 
demonstrated beyond question. Learn why your peers are replacing JEE 
containers with lightweight application servers - and what you can gain 
from the move. http://p.sf.net/sfu/vmware-sfemails
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.