sandy.sm
sandy.sm

Reputation: 183

how to configure specific package in log4j.properties

I need to have log4j configuration for specific classes. Does anyone know how can we do it with log4j.properties.

As against, we can add logger with class/package in log4j.xml

<logger name="org.springframework.security">
    <level value="info" />
    <appender-ref ref="console" />
</logger>

I want equivalent configuration in log4j.properties?

Upvotes: 2

Views: 2954

Answers (1)

Ralph
Ralph

Reputation: 120791

The pattern is log4j.logger.<class or package name>=<level>[, appender]

log4j.logger.org.springframework.security=INFO
log4j.logger.org.springframework.security=INFO, console

Upvotes: 5

Related Questions