Migrating to fluent logging (green)

This is a 'green' Flogger migration CL. Green CLs are intended to be as
safe as possible and should be easy to review and submit.

No changes should be necessary to the code itself prior to submission,
but small changes to BUILD files may be required.

Changes within files are completely independent of each other, so this CL
can be safely split up for review using tools such as Rosie.

For more information, see []
Base CL: 197331037

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=197466715
This commit is contained in:
jianglai 2018-05-21 15:08:53 -07:00
parent 3983f32795
commit 05f166918f
12 changed files with 64 additions and 78 deletions

View file

@ -20,7 +20,7 @@ import static google.registry.proxy.handler.ProxyProtocolHandler.REMOTE_ADDRESS_
import static google.registry.proxy.handler.SslServerInitializer.CLIENT_CERTIFICATE_PROMISE_KEY;
import static google.registry.util.X509Utils.getCertificateHash;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import google.registry.proxy.metric.FrontendMetrics;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
@ -40,7 +40,7 @@ import java.util.function.Supplier;
/** Handler that processes EPP protocol logic. */
public class EppServiceHandler extends HttpsRelayServiceHandler {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
/**
* Attribute key to the client certificate hash whose value is set when the certificate promise is
@ -118,7 +118,7 @@ public class EppServiceHandler extends HttpsRelayServiceHandler {
"epp", sslClientCertificateHash, ctx.channel());
channelRead(ctx, Unpooled.wrappedBuffer(helloBytes));
} else {
logger.severefmt(promise.cause(), "Cannot finish handshake.");
logger.atSevere().withCause(promise.cause()).log("Cannot finish handshake.");
ChannelFuture unusedFuture = ctx.close();
}
});