Migrate to Flogger (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: 197826149

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=198560170
This commit is contained in:
jianglai 2018-05-30 07:58:51 -07:00
parent 0d2fb3a8f0
commit 70b13596e4
178 changed files with 984 additions and 988 deletions

View file

@ -23,7 +23,6 @@ java_library(
visibility = ["//visibility:public"],
deps = [
":soy_java_wrappers",
"//java/com/google/common/logging:formatting_logger",
"//java/google/registry/config",
"//java/google/registry/dns",
"//java/google/registry/model",
@ -40,6 +39,8 @@ java_library(
"@com_google_auto_value",
"@com_google_code_findbugs_jsr305",
"@com_google_dagger",
"@com_google_flogger",
"@com_google_flogger_system_backend",
"@com_google_guava",
"@com_google_monitoring_client_metrics",
"@com_googlecode_json_simple",

View file

@ -29,7 +29,7 @@ import static org.json.simple.JSONValue.toJSONString;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Iterables;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import com.google.common.net.InternetDomainName;
import com.google.common.net.MediaType;
import com.google.template.soy.SoyFileSet;
@ -64,7 +64,7 @@ import javax.servlet.http.HttpServletRequest;
)
public class CheckApiAction implements Runnable {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private static final SoyTofu TOFU =
SoyFileSet.builder().add(getResource(DomainCheckFeeEppSoyInfo.class,
@ -138,7 +138,7 @@ public class CheckApiAction implements Runnable {
}
return builder.build();
} catch (Exception e) {
logger.warning(e, "Unknown error");
logger.atWarning().withCause(e).log("Unknown error");
return fail("Invalid request");
}
}

View file

@ -15,6 +15,7 @@
package google.registry.flows;
import static com.google.common.base.Strings.nullToEmpty;
import static com.google.common.flogger.LazyArgs.lazy;
import static com.google.common.io.BaseEncoding.base64;
import static google.registry.flows.EppXmlTransformer.unmarshal;
import static google.registry.flows.FlowReporter.extractTlds;
@ -24,7 +25,7 @@ import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Joiner;
import com.google.common.base.Strings;
import com.google.common.collect.ImmutableMap;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import google.registry.flows.FlowModule.EppExceptionInProviderException;
import google.registry.model.eppcommon.Trid;
import google.registry.model.eppinput.EppInput;
@ -35,7 +36,6 @@ import google.registry.model.eppoutput.Result.Code;
import google.registry.monitoring.whitebox.BigQueryMetricsEnqueuer;
import google.registry.monitoring.whitebox.EppMetric;
import java.util.Optional;
import java.util.logging.Level;
import javax.inject.Inject;
import org.json.simple.JSONValue;
@ -46,7 +46,8 @@ import org.json.simple.JSONValue;
*/
public final class EppController {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private static final String LOG_SEPARATOR = Strings.repeat("=", 40);
@Inject FlowComponent.Builder flowComponentBuilder;
@Inject EppMetric.Builder eppMetricBuilder;
@ -71,25 +72,27 @@ public final class EppController {
eppInput = unmarshal(EppInput.class, inputXmlBytes);
} catch (EppException e) {
// Log the unmarshalling error, with the raw bytes (in base64) to help with debugging.
if (logger.isLoggable(Level.INFO)) {
logger.infofmt(
e,
"EPP request XML unmarshalling failed - \"%s\":\n%s\n%s\n%s\n%s",
e.getMessage(),
JSONValue.toJSONString(
ImmutableMap.<String, Object>of(
"clientId",
nullToEmpty(sessionMetadata.getClientId()),
"resultCode",
e.getResult().getCode().code,
"resultMessage",
e.getResult().getCode().msg,
"xmlBytes",
base64().encode(inputXmlBytes))),
Strings.repeat("=", 40),
new String(inputXmlBytes, UTF_8).trim(), // Charset decoding failures are swallowed.
Strings.repeat("=", 40));
}
logger.atInfo().withCause(e).log(
"EPP request XML unmarshalling failed - \"%s\":\n%s\n%s\n%s\n%s",
e.getMessage(),
lazy(
() ->
JSONValue.toJSONString(
ImmutableMap.<String, Object>of(
"clientId",
nullToEmpty(sessionMetadata.getClientId()),
"resultCode",
e.getResult().getCode().code,
"resultMessage",
e.getResult().getCode().msg,
"xmlBytes",
base64().encode(inputXmlBytes)))),
LOG_SEPARATOR,
lazy(
() ->
new String(inputXmlBytes, UTF_8)
.trim()), // Charset decoding failures are swallowed.
LOG_SEPARATOR);
// Return early by sending an error message, with no clTRID since we couldn't unmarshal it.
eppMetricBuilder.setStatus(e.getResult().getCode());
return getErrorResponse(
@ -133,12 +136,12 @@ public final class EppController {
} catch (EppException | EppExceptionInProviderException e) {
// The command failed. Send the client an error message, but only log at INFO since many of
// these failures are innocuous or due to client error, so there's nothing we have to change.
logger.info(e, "Flow returned failure response");
logger.atInfo().withCause(e).log("Flow returned failure response");
EppException eppEx = (EppException) (e instanceof EppException ? e : e.getCause());
return getErrorResponse(eppEx.getResult(), flowComponent.trid());
} catch (Throwable e) {
// Something bad and unexpected happened. Send the client a generic error, and log at SEVERE.
logger.severe(e, "Unexpected failure in flow execution");
logger.atSevere().withCause(e).log("Unexpected failure in flow execution");
return getErrorResponse(Result.create(Code.COMMAND_FAILED), flowComponent.trid());
}
}

View file

@ -20,7 +20,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import static javax.servlet.http.HttpServletResponse.SC_BAD_REQUEST;
import static javax.servlet.http.HttpServletResponse.SC_OK;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import com.google.common.net.MediaType;
import google.registry.model.eppoutput.EppOutput;
import google.registry.request.Response;
@ -32,7 +32,7 @@ public class EppRequestHandler {
private static final MediaType APPLICATION_EPP_XML =
MediaType.create("application", "epp+xml").withCharset(UTF_8);
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
@Inject EppController eppController;
@Inject Response response;
@ -71,7 +71,7 @@ public class EppRequestHandler {
response.setHeader("Epp-Session", "close");
}
} catch (Exception e) {
logger.warning(e, "handleEppCommand general exception");
logger.atWarning().withCause(e).log("handleEppCommand general exception");
response.setStatus(SC_BAD_REQUEST);
}
}

View file

@ -14,7 +14,7 @@
package google.registry.flows;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import google.registry.request.Action;
import google.registry.request.Action.Method;
import google.registry.request.Payload;
@ -33,7 +33,7 @@ import javax.servlet.http.HttpSession;
)
public class EppTlsAction implements Runnable {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
@Inject @Payload byte[] inputXmlBytes;
@Inject TlsCredentials tlsCredentials;
@ -46,7 +46,7 @@ public class EppTlsAction implements Runnable {
// Check that SNI header is present. This is a signal that we're receiving traffic proxied by a
// GFE, which is the expectation of this servlet. The value is unused.
if (!tlsCredentials.hasSni()) {
logger.warning("Request did not include required SNI header.");
logger.atWarning().log("Request did not include required SNI header.");
}
eppRequestHandler.executeEpp(
new HttpSessionMetadata(session),

View file

@ -22,7 +22,7 @@ import static java.nio.charset.StandardCharsets.UTF_8;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Throwables;
import com.google.common.collect.ImmutableList;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import google.registry.flows.EppException.ParameterValueRangeErrorException;
import google.registry.flows.EppException.ParameterValueSyntaxErrorException;
import google.registry.flows.EppException.SyntaxErrorException;
@ -44,7 +44,7 @@ import java.util.List;
/** {@link XmlTransformer} for marshalling to and from the Epp model classes. */
public class EppXmlTransformer {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
// Hardcoded XML schemas, ordered with respect to dependency.
private static final ImmutableList<String> SCHEMAS = ImmutableList.of(
@ -130,8 +130,8 @@ public class EppXmlTransformer {
try {
byte[] lenient = EppXmlTransformer.marshal(eppOutput, LENIENT);
// Marshaling worked even though the results didn't validate against the schema.
logger.severefmt(
e, "Result marshaled but did not validate: %s", new String(lenient, UTF_8));
logger.atSevere().withCause(e).log(
"Result marshaled but did not validate: %s", new String(lenient, UTF_8));
return lenient;
} catch (XmlException e2) {
throw new RuntimeException(e2); // Failing to marshal at all is not recoverable.

View file

@ -22,7 +22,7 @@ import static google.registry.model.eppcommon.ProtocolDefinition.ServiceExtensio
import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import google.registry.flows.EppException.CommandUseErrorException;
import google.registry.flows.EppException.SyntaxErrorException;
import google.registry.flows.EppException.UnimplementedExtensionException;
@ -45,7 +45,7 @@ import javax.inject.Inject;
*/
public final class ExtensionManager {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
/** Blacklist of extension URIs that cause an error if they are used without being declared. */
private static final ImmutableSet<String> UNDECLARED_URIS_BLACKLIST = FEE_EXTENSION_URIS;
@ -99,11 +99,9 @@ public final class ExtensionManager {
if (!undeclaredUrisThatError.isEmpty()) {
throw new UndeclaredServiceExtensionException(undeclaredUrisThatError);
}
logger.infofmt(
logger.atInfo().log(
"Client %s is attempting to run %s without declaring URIs %s on login",
clientId,
flowClass.getSimpleName(),
undeclaredUris);
clientId, flowClass.getSimpleName(), undeclaredUris);
}
private void checkForRestrictedExtensions(
@ -155,7 +153,7 @@ public final class ExtensionManager {
ImmutableSet<Class<? extends CommandExtension>> unimplementedExtensions =
unimplementedExtensionsBuilder.build();
if (!unimplementedExtensions.isEmpty()) {
logger.infofmt("Unimplemented extensions: %s", unimplementedExtensions);
logger.atInfo().log("Unimplemented extensions: %s", unimplementedExtensions);
throw new UnimplementedExtensionException();
}
}

View file

@ -24,14 +24,13 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Streams;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import google.registry.flows.FlowModule.ClientId;
import google.registry.flows.FlowModule.InputXml;
import google.registry.flows.annotations.ReportingSpec;
import google.registry.model.eppcommon.Trid;
import google.registry.model.eppinput.EppInput;
import java.util.Optional;
import java.util.logging.Level;
import javax.inject.Inject;
import org.json.simple.JSONValue;
@ -52,7 +51,7 @@ public class FlowReporter {
*/
private static final String METADATA_LOG_SIGNATURE = "FLOW-LOG-SIGNATURE-METADATA";
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
@Inject Trid trid;
@Inject @ClientId String clientId;
@ -65,44 +64,38 @@ public class FlowReporter {
public void recordToLogs() {
// WARNING: These log statements are parsed by reporting pipelines - be careful when changing.
// It should be safe to add new keys, but be very cautious in changing existing keys.
if (logger.isLoggable(Level.INFO)) {
logger.infofmt(
"%s: %s",
EPPINPUT_LOG_SIGNATURE,
JSONValue.toJSONString(
ImmutableMap.<String, Object>of(
"xml", prettyPrint(inputXmlBytes),
"xmlBytes", base64().encode(inputXmlBytes))));
}
logger.atInfo().log(
"%s: %s",
EPPINPUT_LOG_SIGNATURE,
JSONValue.toJSONString(
ImmutableMap.<String, Object>of(
"xml", prettyPrint(inputXmlBytes),
"xmlBytes", base64().encode(inputXmlBytes))));
// Explicitly log flow metadata separately from the EPP XML itself so that it stays compact
// enough to be sure to fit in a single log entry (the XML part in rare cases could be long
// enough to overflow into multiple log entries, breaking routine parsing of the JSON format).
String singleTargetId = eppInput.getSingleTargetId().orElse("");
ImmutableList<String> targetIds = eppInput.getTargetIds();
if (logger.isLoggable(Level.INFO)) {
logger.infofmt(
"%s: %s",
METADATA_LOG_SIGNATURE,
JSONValue.toJSONString(
new ImmutableMap.Builder<String, Object>()
.put("serverTrid", trid.getServerTransactionId())
.put("clientId", clientId)
.put("commandType", eppInput.getCommandType())
.put("resourceType", eppInput.getResourceType().orElse(""))
.put("flowClassName", flowClass.getSimpleName())
.put("targetId", singleTargetId)
.put("targetIds", targetIds)
.put(
"tld",
eppInput.isDomainResourceType() ? extractTld(singleTargetId).orElse("") : "")
.put(
"tlds",
eppInput.isDomainResourceType()
? extractTlds(targetIds).asList()
: EMPTY_LIST)
.put("icannActivityReportField", extractActivityReportField(flowClass))
.build()));
}
logger.atInfo().log(
"%s: %s",
METADATA_LOG_SIGNATURE,
JSONValue.toJSONString(
new ImmutableMap.Builder<String, Object>()
.put("serverTrid", trid.getServerTransactionId())
.put("clientId", clientId)
.put("commandType", eppInput.getCommandType())
.put("resourceType", eppInput.getResourceType().orElse(""))
.put("flowClassName", flowClass.getSimpleName())
.put("targetId", singleTargetId)
.put("targetIds", targetIds)
.put(
"tld",
eppInput.isDomainResourceType() ? extractTld(singleTargetId).orElse("") : "")
.put(
"tlds",
eppInput.isDomainResourceType() ? extractTlds(targetIds).asList() : EMPTY_LIST)
.put("icannActivityReportField", extractActivityReportField(flowClass))
.build()));
}
/**

View file

@ -18,7 +18,7 @@ import static google.registry.model.ofy.ObjectifyService.ofy;
import static google.registry.xml.XmlTransformer.prettyPrint;
import com.google.common.base.Strings;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import google.registry.flows.FlowModule.ClientId;
import google.registry.flows.FlowModule.DryRun;
import google.registry.flows.FlowModule.InputXml;
@ -28,7 +28,6 @@ import google.registry.flows.session.LoginFlow;
import google.registry.model.eppcommon.Trid;
import google.registry.model.eppoutput.EppOutput;
import google.registry.monitoring.whitebox.EppMetric;
import java.util.logging.Level;
import javax.inject.Inject;
import javax.inject.Provider;
@ -37,7 +36,7 @@ public class FlowRunner {
private static final String COMMAND_LOG_FORMAT = "EPP Command" + Strings.repeat("\n\t%s", 8);
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
@Inject @ClientId String clientId;
@Inject TransportCredentials credentials;
@ -57,18 +56,16 @@ public class FlowRunner {
public EppOutput run(final EppMetric.Builder eppMetricBuilder) throws EppException {
String prettyXml = prettyPrint(inputXmlBytes);
if (logger.isLoggable(Level.INFO)) {
logger.infofmt(
COMMAND_LOG_FORMAT,
trid.getServerTransactionId(),
clientId,
sessionMetadata,
prettyXml.replace("\n", "\n\t"),
credentials,
eppRequestSource,
isDryRun ? "DRY_RUN" : "LIVE",
isSuperuser ? "SUPERUSER" : "NORMAL");
}
logger.atInfo().log(
COMMAND_LOG_FORMAT,
trid.getServerTransactionId(),
clientId,
sessionMetadata,
prettyXml.replace("\n", "\n\t"),
credentials,
eppRequestSource,
isDryRun ? "DRY_RUN" : "LIVE",
isSuperuser ? "SUPERUSER" : "NORMAL");
// Record flow info to the GAE request logs for reporting purposes if it's not a dry run.
if (!isDryRun) {
flowReporter.recordToLogs();

View file

@ -21,7 +21,7 @@ import static google.registry.request.RequestParameters.extractRequiredHeader;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableList;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import com.google.common.net.HostAndPort;
import com.google.common.net.InetAddresses;
import dagger.Module;
@ -55,7 +55,7 @@ import javax.servlet.http.HttpServletRequest;
*/
public class TlsCredentials implements TransportCredentials {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private final String clientCertificateHash;
private final String sni;
@ -100,7 +100,7 @@ public class TlsCredentials implements TransportCredentials {
private void validateIp(Registrar registrar) throws AuthenticationErrorException {
ImmutableList<CidrAddressBlock> ipWhitelist = registrar.getIpAddressWhitelist();
if (ipWhitelist.isEmpty()) {
logger.infofmt(
logger.atInfo().log(
"Skipping IP whitelist check because %s doesn't have an IP whitelist",
registrar.getClientId());
return;
@ -111,7 +111,7 @@ public class TlsCredentials implements TransportCredentials {
return;
}
}
logger.infofmt(
logger.atInfo().log(
"Authentication error: IP address %s is not whitelisted for registrar %s; whitelist is: %s",
clientInetAddr, registrar.getClientId(), ipWhitelist);
throw new BadRegistrarIpAddressException();
@ -127,7 +127,7 @@ public class TlsCredentials implements TransportCredentials {
private void validateCertificate(Registrar registrar) throws AuthenticationErrorException {
if (isNullOrEmpty(registrar.getClientCertificateHash())
&& isNullOrEmpty(registrar.getFailoverClientCertificateHash())) {
logger.infofmt(
logger.atInfo().log(
"Skipping SSL certificate check because %s doesn't have any certificate hashes on file",
registrar.getClientId());
return;
@ -138,12 +138,12 @@ public class TlsCredentials implements TransportCredentials {
if (!hasSni()) {
throw new NoSniException();
}
logger.info("Request did not include X-SSL-Certificate");
logger.atInfo().log("Request did not include X-SSL-Certificate");
throw new MissingRegistrarCertificateException();
}
if (!clientCertificateHash.equals(registrar.getClientCertificateHash())
&& !clientCertificateHash.equals(registrar.getFailoverClientCertificateHash())) {
logger.warningfmt(
logger.atWarning().log(
"bad certificate hash (%s) for %s, wanted either %s or %s",
clientCertificateHash,
registrar.getClientId(),

View file

@ -19,7 +19,7 @@ import com.google.appengine.api.taskqueue.TaskOptions;
import com.google.appengine.api.taskqueue.TaskOptions.Method;
import com.google.appengine.api.taskqueue.TransientFailureException;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import com.googlecode.objectify.Key;
import google.registry.config.RegistryConfig.Config;
import google.registry.model.EppResource;
@ -47,7 +47,7 @@ public final class AsyncFlowEnqueuer {
public static final String QUEUE_ASYNC_DELETE = "async-delete-pull";
public static final String QUEUE_ASYNC_HOST_RENAME = "async-host-rename-pull";
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private final Duration asyncDeleteDelay;
private final Queue asyncDeletePullQueue;
@ -75,7 +75,7 @@ public final class AsyncFlowEnqueuer {
Trid trid,
boolean isSuperuser) {
Key<EppResource> resourceKey = Key.create(resourceToDelete);
logger.infofmt(
logger.atInfo().log(
"Enqueuing async deletion of %s on behalf of registrar %s.",
resourceKey, requestingClientId);
TaskOptions task =
@ -95,7 +95,7 @@ public final class AsyncFlowEnqueuer {
/** Enqueues a task to asynchronously refresh DNS for a renamed host. */
public void enqueueAsyncDnsRefresh(HostResource host, DateTime now) {
Key<HostResource> hostKey = Key.create(host);
logger.infofmt("Enqueuing async DNS refresh for renamed host %s.", hostKey);
logger.atInfo().log("Enqueuing async DNS refresh for renamed host %s.", hostKey);
addTaskToQueueWithRetry(
asyncDnsRefreshPullQueue,
TaskOptions.Builder.withMethod(Method.PULL)

View file

@ -15,14 +15,13 @@
package google.registry.flows.async;
import static com.google.appengine.api.taskqueue.QueueConstants.maxLeaseCount;
import static com.google.common.logging.FormattingLogger.getLoggerForCallerClass;
import static com.google.monitoring.metrics.EventMetric.DEFAULT_FITTER;
import static google.registry.flows.async.AsyncFlowMetrics.OperationType.CONTACT_AND_HOST_DELETE;
import static google.registry.flows.async.AsyncFlowMetrics.OperationType.DNS_REFRESH;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.collect.ImmutableSet;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import com.google.monitoring.metrics.DistributionFitter;
import com.google.monitoring.metrics.EventMetric;
import com.google.monitoring.metrics.FibonacciFitter;
@ -42,7 +41,7 @@ import org.joda.time.Duration;
*/
public class AsyncFlowMetrics {
private static final FormattingLogger logger = getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
private final Clock clock;
@ -153,7 +152,7 @@ public class AsyncFlowMetrics {
processingMillis,
operationType.getMetricLabelValue(),
operationResult.getMetricLabelValue());
logger.infofmt(
logger.atInfo().log(
"Asynchronous %s operation took %d ms to process, yielding result: %s.",
operationType.getMetricLabelValue(),
processingMillis,

View file

@ -18,7 +18,7 @@ import static com.google.common.collect.Sets.difference;
import static google.registry.util.CollectionUtils.nullToEmpty;
import com.google.common.collect.ImmutableSet;
import com.google.common.logging.FormattingLogger;
import com.google.common.flogger.FluentLogger;
import google.registry.flows.EppException;
import google.registry.flows.EppException.AuthenticationErrorClosingConnectionException;
import google.registry.flows.EppException.AuthenticationErrorException;
@ -67,7 +67,7 @@ import javax.inject.Inject;
*/
public class LoginFlow implements Flow {
private static final FormattingLogger logger = FormattingLogger.getLoggerForCallerClass();
private static final FluentLogger logger = FluentLogger.forEnclosingClass();
/** Maximum number of failed login attempts allowed per connection. */
private static final int MAX_FAILED_LOGIN_ATTEMPTS_PER_CONNECTION = 3;
@ -86,7 +86,7 @@ public class LoginFlow implements Flow {
try {
return runWithoutLogging();
} catch (EppException e) {
logger.warning("Login failed: " + e.getMessage());
logger.atWarning().log("Login failed: %s", e.getMessage());
throw e;
}
}