<dependency> <groupId>org.appmon4j</groupId> <artifactId>appmon4j-core</artifactId> <version>1.0.0</version> </dependency> import org.appmon4j.core.Appmon4j; import org.appmon4j.core.config.Configuration; public class MyApp { public static void main(String[] args) { Appmon4j appmon4j = new Appmon4j(); Configuration configuration = Configuration.fromFile("appmon4j.yml"); appmon4j.setConfiguration(configuration); appmon4j.start(); } } import org.appmon4j.core.Logger; public class MyClass { private static final Logger logger = Appmon4j.logger(MyClass.class); public void myMethod() { } } import org.appmon4j.core.Monitor; public class MyClass { @Monitor public void myMethod() { } } yaml monitors: - name: MyMethodMonitor include: - com.example.MyClass.myMethod exclude: - com.example.MyClass.anotherMethod logLevel: INFO logs: - name: myLogFile file: /path/to/log/file.log level: DEBUG


上一篇:
下一篇:
切换中文