org.wildfly.swarm.config.logging.ConsoleHandler Maven / Gradle / Ivy
package org.wildfly.swarm.config.logging;
import org.wildfly.config.runtime.Implicit;
import org.wildfly.config.runtime.ResourceType;
import org.wildfly.config.runtime.ModelNodeBinding;
/**
* Defines a handler which writes to the console.
*/
@ResourceType("console-handler")
public class ConsoleHandler {
private String key;
private Boolean autoflush;
private Boolean enabled;
private String encoding;
private String filterSpec;
private String formatter;
private String level;
private String namedFormatter;
private String target;
public ConsoleHandler(String key) {
this.key = key;
}
public String getKey() {
return this.key;
}
/**
* Automatically flush after each write.
*/
@ModelNodeBinding(detypedName = "autoflush")
public Boolean autoflush() {
return this.autoflush;
}
/**
* Automatically flush after each write.
*/
@SuppressWarnings("unchecked")
public ConsoleHandler autoflush(Boolean value) {
this.autoflush = value;
return (ConsoleHandler) this;
}
/**
* If set to true the handler is enabled and functioning as normal, if set to false the handler is ignored when processing log messages.
*/
@ModelNodeBinding(detypedName = "enabled")
public Boolean enabled() {
return this.enabled;
}
/**
* If set to true the handler is enabled and functioning as normal, if set to false the handler is ignored when processing log messages.
*/
@SuppressWarnings("unchecked")
public ConsoleHandler enabled(Boolean value) {
this.enabled = value;
return (ConsoleHandler) this;
}
/**
* The character encoding used by this Handler.
*/
@ModelNodeBinding(detypedName = "encoding")
public String encoding() {
return this.encoding;
}
/**
* The character encoding used by this Handler.
*/
@SuppressWarnings("unchecked")
public ConsoleHandler encoding(String value) {
this.encoding = value;
return (ConsoleHandler) this;
}
/**
* A filter expression value to define a filter. Example for a filter that does not match a pattern: not(match("JBAS.*"))
*/
@ModelNodeBinding(detypedName = "filter-spec")
public String filterSpec() {
return this.filterSpec;
}
/**
* A filter expression value to define a filter. Example for a filter that does not match a pattern: not(match("JBAS.*"))
*/
@SuppressWarnings("unchecked")
public ConsoleHandler filterSpec(String value) {
this.filterSpec = value;
return (ConsoleHandler) this;
}
/**
* Defines a pattern for the formatter.
*/
@ModelNodeBinding(detypedName = "formatter")
public String formatter() {
return this.formatter;
}
/**
* Defines a pattern for the formatter.
*/
@SuppressWarnings("unchecked")
public ConsoleHandler formatter(String value) {
this.formatter = value;
return (ConsoleHandler) this;
}
/**
* The log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded.
*/
@ModelNodeBinding(detypedName = "level")
public String level() {
return this.level;
}
/**
* The log level specifying which message levels will be logged by this logger. Message levels lower than this value will be discarded.
*/
@SuppressWarnings("unchecked")
public ConsoleHandler level(String value) {
this.level = value;
return (ConsoleHandler) this;
}
/**
* The name of the defined formatter to be used on the handler.
*/
@ModelNodeBinding(detypedName = "named-formatter")
public String namedFormatter() {
return this.namedFormatter;
}
/**
* The name of the defined formatter to be used on the handler.
*/
@SuppressWarnings("unchecked")
public ConsoleHandler namedFormatter(String value) {
this.namedFormatter = value;
return (ConsoleHandler) this;
}
/**
* Defines the target of the console handler. The value can be System.out, System.err or console.
*/
@ModelNodeBinding(detypedName = "target")
public String target() {
return this.target;
}
/**
* Defines the target of the console handler. The value can be System.out, System.err or console.
*/
@SuppressWarnings("unchecked")
public ConsoleHandler target(String value) {
this.target = value;
return (ConsoleHandler) this;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy