Package com.helger.photon.core.interror
Class InternalErrorSettings
- java.lang.Object
-
- com.helger.photon.core.interror.InternalErrorSettings
-
@ThreadSafe public final class InternalErrorSettings extends Object
Global settings for internal error handling.- Author:
- Philip Helger
- See Also:
InternalErrorBuilder
,InternalErrorEmailSettings
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
DEFAULT_ENABLE_FULL_THREAD_DUMPS
static boolean
DEFAULT_SAVE_AS_XML
By default each internal error is also stored as XML.static boolean
DEFAULT_SEND_EMAIL
By default each internal error is also stored as XML.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static com.helger.commons.callback.CallbackList<IInternalErrorCallback>
callbacks()
static InternalErrorEmailSettings
getCopyOfEmailSettings()
static Locale
getFallbackLocale()
static com.helger.commons.collection.impl.ICommonsList<com.helger.commons.email.IEmailAddress>
getSMTPReceiverAddresses()
static com.helger.commons.email.IEmailAddress
getSMTPSenderAddress()
static com.helger.smtp.settings.ISMTPSettings
getSMTPSettings()
static Function<InternalErrorMetadata,File>
getStorageFileProvider()
static boolean
isDumpAllThreads()
static boolean
isSaveAsXML()
static boolean
isSendEmail()
static void
setDefaultStorageFileProvider()
Set the default storage file provider.static void
setDefaultStorageFileProviderUpTo802()
Set the storage file provider to the default before v8.0.3.static void
setDumpAllThreads(boolean bEnableDumpAllThreads)
Enable the creation of a dump of all threads.static void
setFallbackLocale(Locale aFallbackLocale)
Set the fallback locale in case none could be determined.static void
setSaveAsXML(boolean bSaveAsXML)
Save an internal error as XML?static void
setSendEmail(boolean bSendEmail)
Send an email when an internal error occurs?static void
setSMTPReceiverAddress(com.helger.commons.email.IEmailAddress aReceiverAddress)
static void
setSMTPReceiverAddresses(com.helger.commons.email.IEmailAddress... aReceiverAddresses)
static void
setSMTPReceiverAddresses(Iterable<? extends com.helger.commons.email.IEmailAddress> aReceiverAddresses)
static void
setSMTPSenderAddress(com.helger.commons.email.IEmailAddress aSenderAddress)
static void
setSMTPSettings(com.helger.smtp.settings.ISMTPSettings aSMTPSettings)
static void
setStorageFileProvider(Function<InternalErrorMetadata,File> aStorageFileProvider)
Set the provider that defines how to build the filename to save internal error files.
-
-
-
Field Detail
-
DEFAULT_ENABLE_FULL_THREAD_DUMPS
public static final boolean DEFAULT_ENABLE_FULL_THREAD_DUMPS
- See Also:
- Constant Field Values
-
DEFAULT_SEND_EMAIL
public static final boolean DEFAULT_SEND_EMAIL
By default each internal error is also stored as XML.- Since:
- 8.2.2
- See Also:
- Constant Field Values
-
DEFAULT_SAVE_AS_XML
public static final boolean DEFAULT_SAVE_AS_XML
By default each internal error is also stored as XML.- Since:
- 8.2.2
- See Also:
- Constant Field Values
-
-
Method Detail
-
setSMTPSettings
public static void setSMTPSettings(@Nullable com.helger.smtp.settings.ISMTPSettings aSMTPSettings)
-
getSMTPSettings
@Nullable public static com.helger.smtp.settings.ISMTPSettings getSMTPSettings()
-
setSMTPSenderAddress
public static void setSMTPSenderAddress(@Nullable com.helger.commons.email.IEmailAddress aSenderAddress)
-
getSMTPSenderAddress
@Nullable public static com.helger.commons.email.IEmailAddress getSMTPSenderAddress()
-
setSMTPReceiverAddress
public static void setSMTPReceiverAddress(@Nullable com.helger.commons.email.IEmailAddress aReceiverAddress)
-
setSMTPReceiverAddresses
public static void setSMTPReceiverAddresses(@Nullable Iterable<? extends com.helger.commons.email.IEmailAddress> aReceiverAddresses)
-
setSMTPReceiverAddresses
public static void setSMTPReceiverAddresses(@Nullable com.helger.commons.email.IEmailAddress... aReceiverAddresses)
-
getSMTPReceiverAddresses
@Nonnull @ReturnsMutableCopy public static com.helger.commons.collection.impl.ICommonsList<com.helger.commons.email.IEmailAddress> getSMTPReceiverAddresses()
-
getCopyOfEmailSettings
@Nonnull @ReturnsMutableCopy public static InternalErrorEmailSettings getCopyOfEmailSettings()
-
setDumpAllThreads
public static void setDumpAllThreads(boolean bEnableDumpAllThreads)
Enable the creation of a dump of all threads. Warning: this takes a lot of CPU, so enable this only when you are not running a performance critical application! The default is false.- Parameters:
bEnableDumpAllThreads
-true
to enabled,false
to disable.
-
isDumpAllThreads
public static boolean isDumpAllThreads()
- Returns:
true
to dump all threads on internal error,false
to not do it.
-
setSendEmail
public static void setSendEmail(boolean bSendEmail)
Send an email when an internal error occurs? Sending happens only if configuration is available.- Parameters:
bSendEmail
-true
to send,false
to not send
-
isSendEmail
public static boolean isSendEmail()
- Returns:
true
to send an email on an internal error,false
to not do it.
-
setSaveAsXML
public static void setSaveAsXML(boolean bSaveAsXML)
Save an internal error as XML?- Parameters:
bSaveAsXML
-true
to save as XML,false
to not save
-
isSaveAsXML
public static boolean isSaveAsXML()
- Returns:
true
to save internal error as XML,false
to not do it.
-
setFallbackLocale
public static void setFallbackLocale(@Nonnull Locale aFallbackLocale)
Set the fallback locale in case none could be determined.- Parameters:
aFallbackLocale
- Locale to use. May not benull
.- Since:
- 7.0.4
-
getFallbackLocale
@Nonnull public static Locale getFallbackLocale()
- Returns:
- The fallback locale to use. Never
null
. - Since:
- 7.0.4
-
callbacks
@Nonnull @ReturnsMutableObject public static com.helger.commons.callback.CallbackList<IInternalErrorCallback> callbacks()
- Returns:
- The current custom internal error callbacks. Never
null
.
-
getStorageFileProvider
@Nonnull public static Function<InternalErrorMetadata,File> getStorageFileProvider()
- Returns:
- The provider that defines where to save internal errors to.
- Since:
- 8.0.3
-
setStorageFileProvider
public static void setStorageFileProvider(@Nonnull Function<InternalErrorMetadata,File> aStorageFileProvider)
Set the provider that defines how to build the filename to save internal error files.- Parameters:
aStorageFileProvider
- Storage provider. May not benull
- Since:
- 8.0.3
-
setDefaultStorageFileProvider
public static void setDefaultStorageFileProvider()
Set the default storage file provider. In case you played around and want to restore the default behavior.- Since:
- 8.0.3
- See Also:
setStorageFileProvider(Function)
-
setDefaultStorageFileProviderUpTo802
public static void setDefaultStorageFileProviderUpTo802()
Set the storage file provider to the default before v8.0.3. The difference tosetDefaultStorageFileProvider()
is, that this version does not contain a "month" subfolder.- Since:
- 8.0.3
- See Also:
setStorageFileProvider(Function)
-
-