Tracers
[Previous]  [Next] 
|
User Manual [Previous]  [Next] TracersMOTL sets the Console to be its default tracer. However, it provides a set of potential tracers that will have an impact on how tracing is injected and how its collected. Modellers can control the model tracer using a tracer directive. MOTL tracers can be classified into two main categories: Built in tracers and third party tracers. The main difference between these two categories is that the first category of tracers doesn’t require any additional jars imported into your model generated code, while the later requires jars specific to each tracer.
File tracer// this example generates traces using the // File tracer tracer File; @SuppressWarnings("deprecation") class Student { Integer id; trace id; } // The suppressWarnings annotation allows this example // to keep working as of Java 19 as per Umple issue £2018 Load the above code into UmpleOnline Java native logging API// this example generates traces using the Java // native logging API tracer JavaAPI; @SuppressWarnings("deprecation") class Student { Integer id; name; // trace id with default logging level info trace id; // trace name to logging level severe trace name logLevel severe; } Load the above code into UmpleOnline Lttng tracer// this example generates tracespoints using // the Lttng tracer tracer Lttng; class Student { Integer id; trace id; } Load the above code into UmpleOnline log4j tracer with default log4j xml configuration file// this example generates traces using the // log4j tracer // Default log4j xml configuration file is // generated (log4j2.xml) tracer log4j; class Student { Integer id; name; // trace attribute id with log4j level set to (info) trace id logLevel info; // trace attribute id with log4j level set to (error) trace name logLevel error; } Load the above code into UmpleOnline log4j tracer with customized log4j xml configuration file// this example generates traces using the // log4j tracer // // Customized log4j xml configuration file // is generated (log4j2.xml) // // Root logger level will be debug // // Info logging level will be written into // console output // // Error logging level will be written into file tracer log4j root=debug info = console error = file; class Student { Integer id; name; // trace attribute id with log4j level set to (info) trace id logLevel info; // trace attribute id with log4j level set to (error) trace name logLevel error; } Load the above code into UmpleOnline Syntax |