java-monitor

Simple java agent monitor that collect information about classes at runtime

License

License

Categories

Categories

Java Languages
GroupId

GroupId

br.com.markenson
ArtifactId

ArtifactId

java-monitor
Last Version

Last Version

1.0
Release Date

Release Date

Type

Type

jar
Description

Description

java-monitor
Simple java agent monitor that collect information about classes at runtime
Source Code Management

Source Code Management

http://github.com/markenson/java-monitor/tree/master

Download java-monitor

How to add to project

<!-- https://jarcasting.com/artifacts/br.com.markenson/java-monitor/ -->
<dependency>
    <groupId>br.com.markenson</groupId>
    <artifactId>java-monitor</artifactId>
    <version>1.0</version>
</dependency>
// https://jarcasting.com/artifacts/br.com.markenson/java-monitor/
implementation 'br.com.markenson:java-monitor:1.0'
// https://jarcasting.com/artifacts/br.com.markenson/java-monitor/
implementation ("br.com.markenson:java-monitor:1.0")
'br.com.markenson:java-monitor:jar:1.0'
<dependency org="br.com.markenson" name="java-monitor" rev="1.0">
  <artifact name="java-monitor" type="jar" />
</dependency>
@Grapes(
@Grab(group='br.com.markenson', module='java-monitor', version='1.0')
)
libraryDependencies += "br.com.markenson" % "java-monitor" % "1.0"
[br.com.markenson/java-monitor "1.0"]

Dependencies

compile (1)

Group / Artifact Type Version
org.javassist : javassist jar 3.20.0-GA

test (1)

Group / Artifact Type Version
junit : junit jar 3.8.1

Project Modules

There are no modules declared in this project.

java-monitor

Simple java agent monitor that collect information about classes at runtime

How build it?

After clone it, install maven and type the following command:

mvn clean install

How use it?

Add the following parameters to your java application at startup

-javaagent:[JAVA_MONITOR_DIR]/java-monitor-1.0-SNAPSHOT.jar=-class=[REGEX_CLASS] -Djava.util.logging.config.file=[LOG_DIR]/logging.properties

where

-javaagent - location of java-monitor.jar.
-class - regular expression to match with class name that will be monitored.
-Djava.util.logging.config.file - Optional. location of logging.properties with log configuration (destination of log [file, stream, etc] and others configurations). If not specified, [JRE_HOME]/lib/logging.properties will be used.

loggin.properties sample

handlers= java.util.logging.FileHandler,java.util.logging.ConsoleHandler

.level=INFO
br.com.markenson.monitor.java.handlers = java.util.logging.FileHandler
br.com.markenson.monitor.java.level = INFO

java.util.logging.FileHandler.pattern = %h/java%u.log
java.util.logging.FileHandler.limit = 5000000
java.util.logging.FileHandler.count = 10
java.util.logging.FileHandler.formatter = java.util.logging.SimpleFormatter
java.util.logging.SimpleFormatter.format=[%1$tc] %5$s%n 

java.util.logging.ConsoleHandler.level = INFO
java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter

Get results on

{user.home}\java.log

Usage example

java -jar some-app.jar -javaagent:C:\repo\java-monitor\target\java-monitor-1.0-SNAPSHOT.jar=-class=.* -Djava.util.logging.config.file=c:\logs\logging.properties

Releases

0.0.1 - Initial version

0.0.2 - Java 7/8 support

Versions

Version
1.0