@Valid @NotNull @JsonProperty("logging") private LoggingFactory loggingFactory = new LoggingFactory(); public LoggingFactory getLoggingFactory() { return loggingFactory; }
/** * <p>Initialises the core services, and can act as an independent starting point for headless operations</p> * * @param args Any command line arguments */ public static void main(String[] args) { // Order is important here applicationEventService = new ApplicationEventService(); environmentCheckingService = new EnvironmentCheckingService(); if (configurationService == null) { bootstrap(); } // Configure logging now that we have a configuration new LoggingFactory(Configurations.currentConfiguration.getLogging(), "MultiBit HD").configure(); // Start environment checking service environmentCheckingService.start(); // Start application event service applicationEventService.start(); // Create Payment Protocol service (once configuration identifies the network parameters) paymentProtocolService = new PaymentProtocolService(BitcoinNetwork.current().get()); paymentProtocolService.start(); // Configure Bitcoinj Threading.UserThread.WARNING_THRESHOLD = Integer.MAX_VALUE; }
public void configure() { hijackJDKLogging(); final Logger root = configureLevels(); final LoggingConfiguration.ConsoleConfiguration console = config.getConsoleConfiguration(); if (console.isEnabled()) { root.addAppender(AsyncAppender.wrap( LogbackFactory.buildConsoleAppender( console, root.getLoggerContext(), console.getLogFormat()))); } final LoggingConfiguration.FileConfiguration file = config.getFileConfiguration(); if (file.isEnabled()) { root.addAppender(AsyncAppender.wrap( LogbackFactory.buildFileAppender( file, root.getLoggerContext(), file.getLogFormat()))); } final LoggingConfiguration.SyslogConfiguration syslog = config.getSyslogConfiguration(); if (syslog.isEnabled()) { root.addAppender(AsyncAppender.wrap( LogbackFactory.buildSyslogAppender( syslog, root.getLoggerContext(), name, syslog.getLogFormat()))); } }
public static void bootstrap() { // Initially configure for DEBUG console logging final LoggingConfiguration.ConsoleConfiguration console = new LoggingConfiguration.ConsoleConfiguration(); console.setEnabled(true); console.setTimeZone(TimeZone.getDefault()); console.setThreshold(Level.DEBUG); final Logger root = getCleanRoot(); root.addAppender(LogbackFactory.buildConsoleAppender( console, root.getLoggerContext(), null )); final LoggingConfiguration.FileConfiguration file = new LoggingConfiguration.FileConfiguration(); root.addAppender(LogbackFactory.buildFileAppender(file, root.getLoggerContext(), null)); // Add this to indicate that logging has bootstrapped with synchronous default settings log.info("LoggingFactory bootstrap completed."); }
LoggingFactory.bootstrap();