crwdns122267:0crwdne122267:0
crwdns122269:0crwdne122269:0
crwdns122271:0crwdne122271:0
crwdns122273:0crwdne122273:0
crwdns122275:0crwdne122275:0
crwdns122277:0crwdne122277:0
crwdns122279:0crwdne122279:0
crwdns122281:0crwdne122281:0
Note
crwdns122283:0:doc:crwdne122283:0
crwdns122285:0crwdne122285:0
import com.google.inject.Inject;
import org.slf4j.Logger;
@Inject
private Logger logger;
crwdns122287:0crwdne122287:0
private Logger logger;
@Inject
private void setLogger(Logger logger) {
this.logger = logger;
}
crwdns122289:0crwdne122289:0
// For the purpose of this example, "Banana" is the class name
private Logger logger;
@Inject
public Banana(Logger logger) {
this.logger = logger;
}
crwdns122291:0crwdne122291:0
crwdns122293:0crwdne122293:0
public Logger getLogger() {
return logger;
}
crwdns122295:0crwdne122295:0
crwdns122297:0crwdne122297:0
Note
crwdns122299:0crwdne122299:0
getLogger().info("String");
getLogger().debug("String");
getLogger().warn("String");
getLogger().error("String");
crwdns122301:0crwdne122301:0
getLogger().warn("This is a warning!");
crwdns122303:0crwdne122303:0
Note
crwdns122305:0crwdne122305:0
crwdns122307:0crwdne122307:0
crwdns122309:0crwdne122309:0
crwdns122311:0:doc:crwdne122311:0
crwdns122313:0crwdne122313:0
((org.apache.logging.log4j.core.Logger) LogManager.getLogger("FtpLoggingFilter")).setLevel(Level.WARN);
crwdns122315:0crwdne122315:0
Warning
crwdns122317:0crwdne122317:0
crwdns122319:0crwdne122319:0