Spring-Boot部署-JBAS011555:无法使用'logging.properties'配置文件配置日志记录 [英] Spring-Boot Deployment -- JBAS011555: Failed to configure logging using 'logging.properties' configuration file

查看:219
本文介绍了Spring-Boot部署-JBAS011555:无法使用'logging.properties'配置文件配置日志记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

又名:如何配置Spring-Boot + JBOSS 7.1服务器的日志记录

尝试针对较旧的JBoss 7.1服务器实例(客户要求)部署spring-boot应用程序.

Trying to deploy a spring-boot application against an older JBoss 7.1 server instance (customer requirement.)

我最初使用的项目在Tomcat下运行良好,但是当我将其部署到JBoss时,它将发出您在下面看到的日志记录错误.我已经通过Google找到了通常的怀疑,即jboss-structure.xml的更改和build.gradle的依赖关系.不过,我仍然显示指示的错误.

I originally was working with a project that stands up fine under Tomcat but when I deploy it to JBoss, it issues the logging error you see below. I have found the usual suspects via Google for both the jboss-structure.xml changes and the build.gradle dependencies. I remain with the indicated error though.

我正在使用:Spring-Boot 1.3.5,对于这个问题的示例,我正在直接从 http://start.spring.io 并对其进行部署,而无需进行任何修改.

I am using: Spring-Boot 1.3.5 and for the example of this question, I am taking a fresh build, directly from http://start.spring.io and deploying it without any modifications.

build.gradle:

buildscript {
    ext {
        springBootVersion = '1.3.5.RELEASE'
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") 
    }
}

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'spring-boot' 
apply plugin: 'war'


war {
    baseName = 'demo'
    version = '0.0.1-SNAPSHOT'
}
sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
    mavenCentral()
}

configurations {
    providedRuntime
}

dependencies {
    compile('org.springframework.boot:spring-boot-starter-actuator')
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-data-rest')
    compile('org.springframework.boot:spring-boot-starter-mustache')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-ws')
    runtime('com.h2database:h2')
    providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
    testCompile('org.springframework.boot:spring-boot-starter-test') 
}


eclipse {
    classpath {
         containers.remove('org.eclipse.jdt.launching.JRE_CONTAINER')
         containers 'org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8'
    }
}

server.log

2016-06-02 13:10:37,946 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-18)  | DeploymentServiceListener constructor for deployment demo-0.0.1-SNAPSHOT.war]
2016-06-02 13:10:37,947 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-18)  | JBAS015876: Starting deployment of "demo-0.0.1-SNAPSHOT.war"
2016-06-02 13:10:39,069 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-14)  | MSC00001: Failed to start service jboss.deployment.unit."demo-0.0.1-SNAPSHOT.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."demo-0.0.1-SNAPSHOT.war".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment "demo-0.0.1-SNAPSHOT.war"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:123) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]
Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011555: Failed to configure logging using 'logging.properties' configuration file.
    at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:125)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116) [jboss-as-server-7.1.2.Final.jar:7.1.2.Final]
    ... 5 more
Caused by: java.lang.IllegalArgumentException: className is null
    at org.jboss.logmanager.config.AbstractPropertyConfiguration.<init>(AbstractPropertyConfiguration.java:52) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
    at org.jboss.logmanager.config.HandlerConfigurationImpl.<init>(HandlerConfigurationImpl.java:54) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
    at org.jboss.logmanager.config.LogContextConfigurationImpl.addHandlerConfiguration(LogContextConfigurationImpl.java:138) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
    at org.jboss.logmanager.PropertyConfigurator.configureHandler(PropertyConfigurator.java:477) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
    at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:379) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
    at org.jboss.logmanager.PropertyConfigurator.configure(PropertyConfigurator.java:92) [jboss-logmanager-1.3.1.Final.jar:1.3.1.Final]
    at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:122)
    ... 6 more

2016-06-02 13:10:39,071 INFO  [org.jboss.as.server] (host-controller-connection-threads - 9)  | JBAS015870: Deploy of deployment "demo-0.0.1-SNAPSHOT.war" was rolled back with failure message {"JBAS014671: Failed services" => {"jboss.deployment.unit.\"demo-0.0.1-SNAPSHOT.war\".POST_MODULE" => "org.jboss.msc.service.StartException in service jboss.deployment.unit.\"demo-0.0.1-SNAPSHOT.war\".POST_MODULE: JBAS018733: Failed to process phase POST_MODULE of deployment \"demo-0.0.1-SNAPSHOT.war\"
    Caused by: org.jboss.as.server.deployment.DeploymentUnitProcessingException: JBAS011555: Failed to configure logging using 'logging.properties' configuration file.
    Caused by: java.lang.IllegalArgumentException: className is null"}}
2016-06-02 13:10:39,095 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-2)  | JBAS015877: Stopped deployment demo-0.0.1-SNAPSHOT.war in 23ms

推荐答案

完成3个步骤,以使其与有用的日志记录一起使用...

Took 3 steps to get this to work with helpful logging...

  1. 以每次部署日志记录模式启动JBoss.我刚刚用export JAVA_OPTS=-Dorg.jboss.as.logging.per-deployment=false
  2. 启动了它
  3. compile('org.slf4j:slf4j-api:1.7.5')添加到我的build.gradle
  4. 在application.properties中配置日志记录(注意:在这种情况下,application.yml似乎不适用于JBoss配置):
  1. Start JBoss in per-deployment logging mode. I just launched it with export JAVA_OPTS=-Dorg.jboss.as.logging.per-deployment=false
  2. Add compile('org.slf4j:slf4j-api:1.7.5') to my build.gradle
  3. Configure logging in application.properties (note: application.yml doesn't seem to work for JBoss config in this case):

logger.level=INFO

logger.handlers=FILE,CONSOLE

handler.CONSOLE=org.jboss.logmanager.handlers.ConsoleHandler
handler.CONSOLE.properties=autoFlush
handler.CONSOLE.level=INFO
handler.CONSOLE.autoFlush=true
handler.CONSOLE.formatter=PATTERN

handler.FILE=org.jboss.logmanager.handlers.FileHandler
handler.FILE.level=DEBUG
handler.FILE.properties=autoFlush,fileName
handler.FILE.autoFlush=true
handler.FILE.fileName=bridge.log
handler.FILE.formatter=PATTERN

formatter.PATTERN=org.jboss.logmanager.formatters.PatternFormatter
formatter.PATTERN.properties=pattern
formatter.PATTERN.pattern=%d{yyyy-MM-dd HH:mm:ss,SSS} %-5p [%c] (%t) %s%E%n

这篇关于Spring-Boot部署-JBAS011555:无法使用'logging.properties'配置文件配置日志记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆