4

我正在使用 frameowrk Hydra:https ://github.com/Findwise/Hydra

我正在试验一个问题。这是logback配置:

<configuration debug="true">

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!-- encoders are assigned the type ch.qos.logback.classic.encoder.PatternLayoutEncoder 
            by default -->
        <encoder>
            <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
            </pattern>
        </encoder>
    </appender>

    <timestamp key="byDay" datePattern="yyyy_MM_dd" />

    <appender name="FILE" class="ch.qos.logback.core.FileAppender">
        <file>${user.home}\cognitive\logs\stages\stages-${byDay}.log</file>
        <encoder>
            <pattern>%date [%thread] %level %logger{10} [%file:%line] %msg%n
            </pattern>
        </encoder>
    </appender>


    <root level="INFO">
        <appender-ref ref="STDOUT" />
        <appender-ref ref="FILE" />
    </root>
</configuration>

发生的情况是,当我运行 main 并执行日志记录时,它工作正常,但是当我构建一个 jar 并且代码通过 hydra 运行时,创建了文件但不执行日志。文件 logback.xml 在 jar 中,内容似乎是适当的,这里是 hydra 控制台中的日志:

13:32:31.349 [Thread-6] INFO  com.findwise.hydra.NodeMaster - Pipeline has been updated
13:32:32.719 [Thread-11] INFO  com.findwise.hydra.StageRunner - Starting stage group CognitiveReferentielStage. Times started so far: 0
13:32:32.722 [Thread-11] INFO  com.findwise.hydra.StageRunner - Launching with command [java, -cp, c:\java\Hydra-0.5.0\distribution\bin\hydra-cognitive\CognitiveReferentielStage\cognitive-hydra-stages-jar-with-dependencies.jar, com.findwise.hydra.stage.GroupStarter, CognitiveReferentielStage, localhost, 12001, false, 12002]
13:32:33.008 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:32,877 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback.groovy]
13:32:33.009 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:32,877 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Could NOT find resource [logback-test.xml]
13:32:33.009 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:32,877 |-INFO in ch.qos.logback.classic.LoggerContext[default] - Found resource [logback.xml] at [jar:file:/C:/java/Hydra-0.5.0/distribution/bin/hydra-cognitive/CognitiveReferentielStage/cognitive-hydra-stages-jar-with-dependencies.jar!/logback.xml]
13:32:33.009 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:32,889 |-INFO in ch.qos.logback.core.joran.spi.ConfigurationWatchList@6ed6ee82 - URL [jar:file:/C:/java/Hydra-0.5.0/distribution/bin/hydra-cognitive/CognitiveReferentielStage/cognitive-hydra-stages-jar-with-dependencies.jar!/logback.xml] is not of type file
13:32:33.020 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,020 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.ConsoleAppender]
13:32:33.023 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,022 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [STDOUT]
13:32:33.037 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,037 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
13:32:33.065 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,065 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Using current interpretation time, i.e. now, as time reference.
13:32:33.065 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,065 |-INFO in ch.qos.logback.core.joran.action.TimestampAction - Adding property to the context with key="byDay" and value="2014_08_08" to the context
13:32:33.066 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,065 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - About to instantiate appender of type [ch.qos.logback.core.FileAppender]
13:32:33.067 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,066 |-INFO in ch.qos.logback.core.joran.action.AppenderAction - Naming appender as [FILE]
13:32:33.068 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,068 |-INFO in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Assuming default type [ch.qos.logback.classic.encoder.PatternLayoutEncoder] for [encoder] property
13:32:33.069 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,069 |-INFO in ch.qos.logback.core.FileAppender[FILE] - File property is set to [C:\Users\Fabien\cognitive\logs\stages\stages-2014_08_08.log]
13:32:33.071 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,071 |-INFO in ch.qos.logback.classic.joran.action.RootLoggerAction - Setting level of ROOT logger to INFO
13:32:33.071 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,071 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [STDOUT] to Logger[ROOT]
13:32:33.072 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,071 |-INFO in ch.qos.logback.core.joran.action.AppenderRefAction - Attaching appender named [FILE] to Logger[ROOT]
13:32:33.073 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,071 |-INFO in ch.qos.logback.classic.joran.action.ConfigurationAction - End of configuration.
13:32:33.074 [Thread-14] INFO  com.findwise.hydra.StreamLogger - Received message from stage CognitiveReferentielStage (stdout): 13:32:33,073 |-INFO in ch.qos.logback.classic.joran.JoranConfigurator@76757fad - Registering current configuration as safe fallback point
13:32:33.081 [Thread-1] INFO  c.q.l.classic.net.SimpleSocketServer - Connected to client at /127.0.0.1
13:32:33.081 [Thread-1] INFO  c.q.l.classic.net.SimpleSocketServer - Starting new socket node.
13:32:33.083 [Thread-1] INFO  c.q.l.classic.net.SimpleSocketServer - Waiting to accept a new client.
13:32:33.342 [I/O dispatcher 2] DEBUG com.findwise.hydra.net.RESTServer - Connection open: 127.0.0.1:12001<->127.0.0.1:51748[ACTIVE]

我没有解决方案。谢谢

4

0 回答 0