Any module anywhere can get a logger using one of the two static methods:

Logger org.slf4j.LoggerFactory.getLogger(String loggerName)

Logger org.slf4j.LoggerFactory.getLogger(Class targetClass)

Calling one or the other is a matter of taste. It does not *have* to be the same logger anywhere in the application, each module can use its own logger. The parameter is generally used as a log line prefix, and can also be used to do a fine tuning of which modules can log at which log level, something we haven't taken advantage so far in Velocity (apart for the Tools themselves).

I chose to use the first variant for sobriety (to avoid each log line contain the whole package name), but it s not necessarily a definitive choice. At least, it should be better documented.

Does your logging work properly with this configuration?

  Claude


On 10/11/2016 11:12, Greg Huber wrote:
The name needs to be exactly Velocity which is not what I had expected,
usually its the package name format ie org.apache.velocity.

<logger name="Velocity" level="DEBUG" additivity="false">
             <appender-ref ref="RollingFile" />
</logger>

the docs suggest its org.apache.velocity.app.Velocity

This seems to be set in RuntimeInstance:

private Logger log = LoggerFactory.getLogger("Velocity");


Then I do not use slf4j so not sure how it should be configured ie per
package.

Cheers Greg



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@velocity.apache.org
For additional commands, e-mail: dev-h...@velocity.apache.org

Reply via email to