SOLR-5188: The default LogWatcher should default to enabled and add some more LogWatcher init logging.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1517805 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2013-08-27 12:57:35 +00:00
parent b755bef24f
commit 4e9f65f2b0
3 changed files with 6 additions and 4 deletions

View File

@ -189,7 +189,7 @@ public abstract class ConfigSolr {
public LogWatcherConfig getLogWatcherConfig() {
return new LogWatcherConfig(
getBool(CfgProp.SOLR_LOGGING_ENABLED, false),
getBool(CfgProp.SOLR_LOGGING_ENABLED, true),
get(CfgProp.SOLR_LOGGING_CLASS, null),
get(CfgProp.SOLR_LOGGING_WATCHER_THRESHOLD, null),
getInt(CfgProp.SOLR_LOGGING_WATCHER_SIZE, 50)

View File

@ -29,7 +29,6 @@ import org.apache.solr.handler.admin.CoreAdminHandler;
import org.apache.solr.handler.admin.InfoHandler;
import org.apache.solr.handler.component.ShardHandlerFactory;
import org.apache.solr.logging.LogWatcher;
import org.apache.solr.logging.jul.JulWatcher;
import org.apache.solr.schema.IndexSchema;
import org.apache.solr.schema.IndexSchemaFactory;
import org.apache.solr.util.DefaultSolrThreadFactory;
@ -193,7 +192,7 @@ public class CoreContainer {
solrCores.allocateLazyCores(cfg.getTransientCacheSize(), loader);
logging = JulWatcher.newRegisteredLogWatcher(cfg.getLogWatcherConfig(), loader);
logging = LogWatcher.newRegisteredLogWatcher(cfg.getLogWatcherConfig(), loader);
shareSchema = cfg.hasSchemaCache();

View File

@ -126,8 +126,10 @@ public abstract class LogWatcher<E> {
*/
public static LogWatcher newRegisteredLogWatcher(LogWatcherConfig config, SolrResourceLoader loader) {
if (!config.isEnabled())
if (!config.isEnabled()) {
log.info("A LogWatcher is not enabled");
return null;
}
LogWatcher logWatcher = createWatcher(config, loader);
@ -148,6 +150,7 @@ public abstract class LogWatcher<E> {
try {
slf4jImpl = StaticLoggerBinder.getSingleton().getLoggerFactoryClassStr();
log.info("SLF4J impl is " + slf4jImpl);
if (fname == null) {
if (slf4jImpl.indexOf("Log4j") > 0) {
fname = "Log4j";