LoggingConfig

@Plugin(name = "ServerPackCreatorConfigFactory", category = "ConfigurationFactory")
class LoggingConfig : ConfigurationFactory

Custom logging configuration setup to prevent incorrect log-directories when executing ServerPackCreator from CLI from a completely other directory. Or possibly when using symlinks, too. This class prevents the logs being written to the logs-directory inside the directory from which SPC is being run from.

Author

Griefed

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
inner class CustomXmlConfiguration(loggerContext: LoggerContext?, configSource: ConfigurationSource?) : XmlConfiguration

Custom XmlConfiguration to pass our custom log4j2.xml config to log4j.

Properties

Link copied to clipboard
protected val substitutor: StrSubstitutor

Functions

Link copied to clipboard
open override fun getConfiguration(loggerContext: LoggerContext, source: ConfigurationSource): Configuration

Depending on whether this is the first run of ServerPackCreator on a users machine, the default log4j2 configuration may be present at different locations. The default one is the config inside the home-directory of SPC, of which we will try to set up our logging with. If said file fails for whatever reason, we will try to use a config inside the directory from which SPC was executed. Should that fail, too, the config from the classpath is used, to ensure we always have default configs available. Should that fail, too, though, log4j is set up with its own default settings.

open fun getConfiguration(loggerContext: LoggerContext, name: String, configLocation: URI): Configuration
open fun getConfiguration(loggerContext: LoggerContext, name: String, configLocation: URI, loader: ClassLoader): Configuration
Link copied to clipboard
protected open fun getDefaultPrefix(): String
Link copied to clipboard
protected open fun getInputFromString(config: String, loader: ClassLoader): ConfigurationSource
Link copied to clipboard
protected open override fun getSupportedTypes(): Array<String>
Link copied to clipboard
protected open fun getTestPrefix(): String
Link copied to clipboard
protected open fun getVersion(): String
Link copied to clipboard
protected open fun isActive(): Boolean