игровой фреймворк
Я пытаюсь использовать пользовательский класс макета для logback Playback 2.0.
Сначала я определил пользовательский класс макета в утилитах пакета:
package utils;
public class MonitorLayoutForLogback extends LayoutBase {
...
}
В моем файле conf / logging.xml я помещаю:
но когда я бегу в игре, например,
play run
Я вижу:
14:20:18,387 |-ERROR in ch.qos.logback.core.joran.action.NestedComplexPropertyIA - Could not create component [layout] of type [utils.MonitorLayoutForLogback] java.lang.ClassNotFoundException: utils.M
onitorLayoutForLogback
at java.lang.ClassNotFoundException: utils.MonitorLayoutForLogback
at at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at at java.security.AccessController.doPrivileged(Native Method)
at at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
at at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
at at sbt.PlayCommands$anonfun$53$anonfun$55$anon$2.loadClass(PlayCommands.scala:535)
at at ch.qos.logback.core.util.Loader.loadClass(Loader.java:124)
at at ch.qos.logback.core.joran.action.NestedComplexPropertyIA.begin(NestedComplexPropertyIA.java:100)
at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:276)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:148)
at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:130)
at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:50)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:157)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:143)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:106)
at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:56)
at at play.api.Logger$anonfun$configure$8.apply(Logger.scala:248)
at at play.api.Logger$anonfun$configure$8.apply(Logger.scala:247)
at at scala.Option.map(Option.scala:145)
at at play.api.Logger$.configure(Logger.scala:247)
at at play.api.Application$class.$init$(Application.scala:266)
Так что играть можнонайти класс макета, который я создал. Как поместить класс макета в путь к классу?
Обратите внимание, что я также пытался поставить проект через,
play clean compile stage
а затем начал проект через
target/start
Начиная проект с упакованной версии, я неt увидеть выше пропущенную ошибку класса. Тем не менее, я также никогда не вижу никакого вывода, и при этом я даже не вижу построенный класс. Я добавил операторы System.out.println для каждого конструктора для этого класса следующим образом, чтобы проверить, был ли класс создан:
public MonitorLayoutForLogback() {
System.out.println("MonitorLayoutForLogback Constructor without arguments");
}
public MonitorLayoutForLogback(String program) {
System.out.println("MonitorLayoutForLogback Constructor with program "+program);
_program = program;
}
public MonitorLayoutForLogback(String program, String sGroup, String sid) {
System.out.println("MonitorLayoutForLogback Constructor with program "+program+" sGroup "+sGroup+" sid "+sid);
_program = program;
MonitoringInfo.setServiceGroup(sGroup);
MonitoringInfo.setServiceIdentifier(sid);
}
я новичок в конфигурации входа, так что яя уверен, что яЯ упускаю что-то очевидное. Спасибо за помощь.