/** * Replace this instance with a homonymous (same name) logger returned * by LoggerFactory. Note that this method is only called during * deserialization. * * <p> * This approach will work well if the desired ILoggerFactory is the one * references by LoggerFactory. However, if the user manages its logger hierarchy * through a different (non-static) mechanism, e.g. dependency injection, then * this approach would be mostly counterproductive. * * @return logger with same name as returned by LoggerFactory * @throws ObjectStreamException */ protected Object readResolve() throws ObjectStreamException { // using getName() instead of this.name works even for // NOPLogger return LoggerFactory.getLogger(getName()); }
/** * Replace this instance with a homonymous (same name) logger returned * by LoggerFactory. Note that this method is only called during * deserialization. * * <p> * This approach will work well if the desired ILoggerFactory is the one * references by LoggerFactory. However, if the user manages its logger hierarchy * through a different (non-static) mechanism, e.g. dependency injection, then * this approach would be mostly counterproductive. * * @return logger with same name as returned by LoggerFactory * @throws ObjectStreamException */ protected Object readResolve() throws ObjectStreamException { // using getName() instead of this.name works even for // NOPLogger return LoggerFactory.getLogger(getName()); }
/** * Replace this instance with a homonymous (same name) logger returned * by LoggerFactory. Note that this method is only called during * deserialization. * * <p> * This approach will work well if the desired ILoggerFactory is the one * references by LoggerFactory. However, if the user manages its logger hierarchy * through a different (non-static) mechanism, e.g. dependency injection, then * this approach would be mostly counterproductive. * * @return logger with same name as returned by LoggerFactory * @throws ObjectStreamException */ protected Object readResolve() throws ObjectStreamException { // using getName() instead of this.name works even for // NOPLogger return LoggerFactory.getLogger(getName()); }