Logger Class
- java.
lang. Object - com.
microsoft. aad. adal. Logger
- com.
public class Logger
Android log output can. If externalLogger is set, it will use that as well. Usage: Logger.v(tag, message, additionalMessage, errorCode) to log. Set custom logger: Logger.setExternalLogger(..);
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
d(String tag, String message)
Logs debug message. |
void |
e(String tag, String message)
Logs error message. |
void |
e(String tag, String message, String additionalMessage, ADALError errorCode)
Logs error message. |
void |
e(String tag, String message, String additionalMessage, ADALError errorCode, Throwable throwable)
Logs error message. |
void |
e(String tag, String message, Throwable throwable)
Logs error message. |
String | getCorrelationId() |
Logger | getInstance() |
void |
i(String tag, String message, String additionalMessage)
Logs informational message. |
void |
i(String tag, String message, String additionalMessage, ADALError errorCode)
Logs informational messages with error codes. |
void |
setAndroidLogEnabled(final boolean androidLogEnabled)
Enable/Disable the Android logcat logging. By default, the sdk disables it. |
void |
setCorrelationId(UUID correlation)
Sets the correlation id for the logger. |
void |
setEnablePII(final boolean enablePII)
ADAL provides logging callbacks that assist in diagnostics. The callback has two parameters, message and additionalMessage. All user information is put into additionalMessage. ADAL will clear this data unless the com.microsoft.identity.common.internal.logging.Logger#mAllowPii is called with true. By default the library will not return any messages with user information in them. |
synchronized void |
setExternalLogger(ILogger externalLogger)
Set the custom logger. Configures external logging to configure a callback that the sdk will use to pass each log message. Overriding the logger callback is not allowed. |
void |
setLogLevel(final LogLevel logLevel)
Set the log level for diagnostic purpose. By default, the sdk enables the verbose level logging. |
void |
v(String tag, String message)
Logs verbose message. |
void |
v(String tag, String message, String additionalMessage, ADALError errorCode)
Logs verbose message with error code. |
void |
w(String tag, String message)
Logs warning message. |
void |
w(String tag, String message, String additionalMessage, ADALError errorCode)
Logs warning message. |
Method Details
d
public static void d(String tag, String message)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#info(String, String, String)"></xref> instead. </p>
</xrefdescription>
Logs debug message.
Parameters:
e
public static void e(String tag, String message)
Logs error message.
Parameters:
e
public static void e(String tag, String message, String additionalMessage, ADALError errorCode)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#error(String, String, String, Throwable)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#errorPII(String, String, String, Throwable)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs error message.
Parameters:
e
public static void e(String tag, String message, String additionalMessage, ADALError errorCode, Throwable throwable)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#error(String, String, String, Throwable)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#errorPII(String, String, String, Throwable)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs error message.
Parameters:
e
public static void e(String tag, String message, Throwable throwable)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#error(String, String, String, Throwable)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#errorPII(String, String, String, Throwable)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs error message.
Parameters:
getCorrelationId
public String getCorrelationId()
Returns:
getInstance
i
public static void i(String tag, String message, String additionalMessage)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#info(String, String, String)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#infoPII(String, String, String)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs informational message.
Parameters:
i
public static void i(String tag, String message, String additionalMessage, ADALError errorCode)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#info(String, String, String)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#infoPII(String, String, String)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs informational messages with error codes.
Parameters:
setAndroidLogEnabled
public void setAndroidLogEnabled(final boolean androidLogEnabled)
Enable/Disable the Android logcat logging. By default, the sdk disables it.
Parameters:
setCorrelationId
public static void setCorrelationId(UUID correlation)
Sets the correlation id for the logger.
Parameters:
setEnablePII
public void setEnablePII(final boolean enablePII)
ADAL provides logging callbacks that assist in diagnostics. The callback has two parameters, message and additionalMessage. All user information is put into additionalMessage. ADAL will clear this data unless the com.microsoft.identity.common.internal.logging.Logger#mAllowPii is called with true. By default the library will not return any messages with user information in them.
Parameters:
setExternalLogger
public synchronized void setExternalLogger(ILogger externalLogger)
Set the custom logger. Configures external logging to configure a callback that the sdk will use to pass each log message. Overriding the logger callback is not allowed.
Parameters:
setLogLevel
public void setLogLevel(final LogLevel logLevel)
Set the log level for diagnostic purpose. By default, the sdk enables the verbose level logging.
Parameters:
v
public static void v(String tag, String message)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#verbose(String, String, String)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#verbosePII(String, String, String)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs verbose message.
Parameters:
v
public static void v(String tag, String message, String additionalMessage, ADALError errorCode)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#verbose(String, String, String)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#verbosePII(String, String, String)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs verbose message with error code.
Parameters:
w
public static void w(String tag, String message)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#warn(String, String, String)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#warnPII(String, String, String)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs warning message.
Parameters:
w
public static void w(String tag, String message, String additionalMessage, ADALError errorCode)
<xreftitle>Deprecated</xreftitle>
<xrefdescription>
<p>use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#warn(String, String, String)"></xref> if the log message does not contain any PII information. use <xref uid="" data-throw-if-not-resolved="false" data-raw-source="com.microsoft.identity.common.internal.logging.Logger#warnPII(String, String, String)"></xref> if the log message contains any PII information. </p>
</xrefdescription>
Logs warning message.
Parameters:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for