Interface LogOutput.ProvidesEncoder
- All Known Implementing Classes:
JfrLogOutput
- Enclosing interface:
LogOutput
public static interface LogOutput.ProvidesEncoder
Marks an output that supplies its own
LogEncoder instead of relying
entirely on LogAppender.APPENDER_ENCODER_PROPERTY or
LogEncoderRegistry.encoderForOutputType(OutputType). policy()
decides whether that encoder can still be overridden:
LogOutput.ProvidesEncoder.Policy.MANDATORY:encoder(String, LogConfig)is the only encoder this output will ever use. Configuring another one anyway - programmatically viaLogAppender.Builder.encoder, or viaLogAppender.APPENDER_ENCODER_PROPERTY- is aLogProperty.ValidationException, not a silent override.LogOutput.ProvidesEncoder.Policy.DEFAULT:encoder(String, LogConfig)is used only if nothing else is configured; either of the above always wins over it.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumWhether aLogOutput.ProvidesEncoder'sencoder(String, LogConfig)can be overridden by another, explicitly configured encoder. -
Method Summary
Modifier and TypeMethodDescriptionThe encoder this output supplies, given the samename/configthe output itself was provided with.default LogOutput.ProvidesEncoder.Policypolicy()Whetherencoder(String, LogConfig)can be overridden by an explicitly configured encoder.
-
Method Details
-
encoder
The encoder this output supplies, given the samename/configthe output itself was provided with.- Parameters:
name- appender name.config- config.- Returns:
- encoder, see
policy()for whether it can be overridden. - API Note
- this method is only ever called once per appender resolution, so an implementation does not need to memoize the returned encoder itself.
-
policy
Whetherencoder(String, LogConfig)can be overridden by an explicitly configured encoder. Defaults toLogOutput.ProvidesEncoder.Policy.DEFAULT- an implementation only needs to override this to returnLogOutput.ProvidesEncoder.Policy.MANDATORY.- Returns:
- policy.
-