Jetty 在维修码头安装中配置提升应用程序日志
我正在Centos 6.x的Jetty服务安装中部署scala lift应用程序。为了更改日志级别和模式,我尝试了所有方法,但总是得到调试和截断的消息 为了配置logback,我遵循了官方文档,同样地,我在没有运气的情况下更改了与日志记录相关的每个配置文件。运行应用程序时,thry-maven可以完美地工作Jetty 在维修码头安装中配置提升应用程序日志,jetty,lift,Jetty,Lift,我正在Centos 6.x的Jetty服务安装中部署scala lift应用程序。为了更改日志级别和模式,我尝试了所有方法,但总是得到调试和截断的消息 为了配置logback,我遵循了官方文档,同样地,我在没有运气的情况下更改了与日志记录相关的每个配置文件。运行应用程序时,thry-maven可以完美地工作mvn-jetty:run,但在服务器中部署war时,可以配置日志记录 我已阅读并尝试: 有人遇到过这样的问题吗 [编辑] 在src/main/resources/props中,我有一个名
mvn-jetty:run
,但在服务器中部署war时,可以配置日志记录
我已阅读并尝试:
有人遇到过这样的问题吗
[编辑]
在src/main/resources/props中,我有一个名为default.props的空文件。(0字节)
在src/main/resources/I内部有一个jetty-logback.xml文件
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d %5p | %.-1000m %n</pattern>
</encoder>
</appender>
<logger name="mx.ssf.sicom.brokerGaspar">
<level value="INFO" />
</logger>
<logger name="mx.ssf.sicom.gasparIntegration">
<level value="INFO" />
</logger>
<logger name="mx.ssf.sicom.commProtocol">
<level value="INFO" />
</logger>
<!-- <logger name="org.hibernate"> -->
<!-- <level value="DEBUG" /> -->
<!-- </logger> -->
<logger name="mx.ssf.sicom.operationalServices">
<level value="INFO" />
</logger>
<logger name="mx.ssf.sicom.catalogsServices.brokerapiImpl">
<level value="INFO" />
</logger>
<root>
<level value="INFO" />
<appender-ref ref="CONSOLE" />
</root>
</configuration>
%d%5p |%.-1000m%n
使用maven运行时,此文件有效。当直接在jetty中部署时,我会按照所有登录jetty的教程将此文件移动到jetty_HOME/resources
启动jetty时没有额外的JVM运行时参数
[编辑2]
在source/main/resources/props中,我有一个名为production.default.logback.xml的文件。该文件的内容与第一次编辑中列出的jetty-logback.xml日志文件相同
我在运行时没有运行running.mode属性。即使这样,我也尝试使用run.mode=development,但结果是一样的
我不使用SBT,我使用scala maven插件。pom的配置有点复杂,因为我们有三个级别的pom配置。从lift web应用程序(子应用程序)的pom开始:
4.0.0
MyLiftApp
LIFTAP项目
mygroupid
0.1.0-SNAPSHOT
..
战争
MyAppName
1.2-m1
斯卡拉多克/
http://scala-tools.org/mvnsites/liftweb
2.9.1
src/main/scala
src/test/scala
org.scala-tools
maven scala插件
2.15.2
过程资源
添加源
编译
scala测试编译
过程测试资源
测试编译
主发射器
mx.ssf.sicom.brokerGaspar.Main
-DdataAccess.props.dir=${project.build.directory}/classes/
${scala.version}
真的
-g:vars
-贬低
-从属文件
${project.build.directory}/.scala\u依赖项
org.apache.maven.plugins
maven surefire插件
2.12
方法
org.apache.maven.plugins
maven编译器插件
2.5.1
1.5
1.5
org.mortbay.jetty
maven jetty插件
6.1.25
logback.configurationFile
${project.build.outputDirectory}/jetty-logback.xml
/
0
8100
net.sf.alchim
yuicompressor maven插件
0.7.1
压缩
真的
mx.ssf.sicom
JPADataAccess
0.1.0-SNAPSHOT
org.rxtx
rxtx
2.1.7
编译
net.liftweb
lift-mapper_2.9.1
2.4-M4
javax.servlet
servlet api
2.5
假如
org.mortbay.jetty
码头
6.1.25
测试
org.scala-lang
scala编译器
${scala.version}
测试
net.databinder
dispatch-http_2.9.1
0.8.8
mx.ssf.sicom
通信协议
0.1.0-SNAPSHOT
mx.ssf.sicom
气体积分
0.1.0-SNAPSHOT
mx.ssf.sicom
斯卡拉科蒙斯
0.1.0-SNAPSHOT
mx.ssf.sicom
CorporateStructureServiceBrokerImpl
0.1.0-SNAPSHOT
mx.ssf.sicom
经纪信息服务
0.1.0-SNAPSHOT
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>MyLiftApp</artifactId>
<parent>
<artifactId>LiftApp-project</artifactId>
<groupId>mygroupid</groupId>
<version>0.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>
<packaging>war</packaging>
<name>MyAppName</name>
<properties>
<maven.scaladoc.vscaladocVersion>1.2-m1</maven.scaladoc.vscaladocVersion>
<vscaladoc.links.liftweb.pathsufix>scaladocs/</vscaladoc.links.liftweb.pathsufix>
<vscaladoc.links.liftweb.baseurl>http://scala-tools.org/mvnsites/liftweb</vscaladoc.links.liftweb.baseurl>
<scala.version>2.9.1</scala.version>
</properties>
<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>org.scala-tools</groupId>
<artifactId>maven-scala-plugin</artifactId>
<version>2.15.2</version>
<executions>
<execution>
<phase>process-resources</phase>
<goals>
<goal>add-source</goal>
<goal>compile</goal>
</goals>
</execution>
<execution>
<id>scala-test-compile</id>
<phase>process-test-resources</phase>
<goals>
<goal>testCompile</goal>
</goals>
</execution>
</executions>
<configuration>
<launchers>
<launcher>
<id>mainLauncher</id>
<mainClass>
mx.ssf.sicom.brokerGaspar.Main
</mainClass>
<jvmArgs>
<jvmArg>-DdataAccess.props.dir=${project.build.directory}/classes/</jvmArg>
</jvmArgs>
</launcher>
</launchers>
<scalaVersion>${scala.version}</scalaVersion>
<sendJavaToScalac>true</sendJavaToScalac>
<args>
<!--arg>-target:jvm-1.5</arg -->
<arg>-g:vars</arg>
<arg>-deprecation</arg>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<parallel>methods</parallel>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.5.1</version>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.25</version>
<configuration>
<systemProperties>
<systemProperty>
<name>logback.configurationFile</name>
<value>${project.build.outputDirectory}/jetty-logback.xml</value>
</systemProperty>
</systemProperties>
<contextPath>/</contextPath>
<scanIntervalSeconds>0</scanIntervalSeconds>
<connectors>
<connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
<port>8100</port>
</connector>
</connectors>
</configuration>
</plugin>
<plugin>
<groupId>net.sf.alchim</groupId>
<artifactId>yuicompressor-maven-plugin</artifactId>
<version>0.7.1</version>
<executions>
<execution>
<goals>
<goal>compress</goal>
</goals>
</execution>
</executions>
<configuration>
<nosuffix>true</nosuffix>
</configuration>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>mx.ssf.sicom</groupId>
<artifactId>JPADataAccess</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.rxtx</groupId>
<artifactId>rxtx</artifactId>
<version>2.1.7</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>net.liftweb</groupId>
<artifactId>lift-mapper_2.9.1</artifactId>
<version>2.4-M4</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.5</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
<version>6.1.25</version>
<scope>test</scope>
</dependency>
<!-- for LiftConsole -->
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-compiler</artifactId>
<version>${scala.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>net.databinder</groupId>
<artifactId>dispatch-http_2.9.1</artifactId>
<version>0.8.8</version>
</dependency>
<dependency>
<groupId>mx.ssf.sicom</groupId>
<artifactId>CommProtocol</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mx.ssf.sicom</groupId>
<artifactId>GasparIntegration</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mx.ssf.sicom</groupId>
<artifactId>ScalaCommons</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mx.ssf.sicom</groupId>
<artifactId>CorporateStructureServiceBrokerImpl</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mx.ssf.sicom</groupId>
<artifactId>BrokerMessagingService</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mx.ssf.sicom</groupId>
<artifactId>OperationalServicesBrokerImpl</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>mx.ssf.sicom</groupId>
<artifactId>CatalogsServiceBrokerImpl</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>TheParent-project</artifactId>
<version>0.1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>TheParent-project</name>
<parent>
<groupId>thegroupid</groupId>
<artifactId>TheParent-Solution</artifactId>
<version>1</version>
</parent>
<modules>
<module>MyLiftApp</module>
<module>OtherModule</module>
<module>OtherModule2</module>
<module>OtherModule3</module>
<module>OtherModule4</module>
<module>OtherModule5</module>
<module>OtherModule6</module>
</modules>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</build>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>mygroupid</groupId>
<artifactId>CommonDomain</artifactId>
<version>0.1.0-SNAPSHOT</version>
</dependency>
</dependencies>
</dependencyManagement>
</project>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>mygroupid</groupId>
<artifactId>TheGreat-Solution</artifactId>
<version>1</version>
<packaging>pom</packaging>
<properties>
<spring.version>3.1.1.RELEASE</spring.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<hibernate.version>4.1.4.Final</hibernate.version>
<hibernate.validator.version>4.3.0.Final</hibernate.validator.version>
</properties>
<organization>
<name>My company</name>
<url>www.www.www</url>
</organization>
<issueManagement>
<url>http://mybt.com</url>
<system>MantisBT</system>
</issueManagement>
<ciManagement>
<system>Jenkins</system>
<url>http://myci.com</url>
</ciManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
<groupId>commons-logging</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.10</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.6.6</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.6</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.6.4</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.0</version>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate.validator.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-envers</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-ehcache</artifactId>
<version>${hibernate.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<!-- To define the plugin version in your parent POM -->
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>1.6</source>
<target>1.6</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
</plugins>
</build>
</project>
Logger.setup = Full(Logback.withFile(pathToLogbackxml))