jloglevel 0.1.4

Creator: bigcodingguy24

Last updated:

Add to Cart

Description:

jloglevel 0.1.4

# jloglevel[![Build Status](https://travis-ci.org/ivanyu/jloglevel.svg?branch=master)](https://travis-ci.org/ivanyu/jloglevel)`jloglevel` is a command line tool for changing the logging level in JVM apps in runtime via [Jolokia](https://jolokia.org/).## How it worksJVM has a technology [Java Management Extensions (JMX)](https://en.wikipedia.org/wiki/Java_Management_Extensions) that allows to monitor and manage JVM applications in runtime. This is done via components called MBeans (managed beans). MBeans have attributes that can be read and operations (methods) that can be executed with JMX.JVM logging libraries expose MBeans which apart from other features allow control of the logging level in runtime. That means that we can change the logging level of loggers inside the application without restart or modification of files.JMX has a drawback: it doesn't go well with firewalls, especially in dynamic cloud environments. To overcome this issues, JMX-HTTP bridges exist, and [Jolokia](https://jolokia.org/) is probably the most popular of them. It exposes JMX MBeans over HTTP and allows us to read attributes and call methods using simple GETs and POSTs.Combining all this together, jloglevel makes it easy to get and set the logging level on a number of JVM applications (e.g. a scaled-out service).Currently, only [Logback](https://logback.qos.ch/) library is supported.## Installation```bashYou can't use 'macro parameter character #' in math modeYou can't use 'macro parameter character #' in math mode jloglevel list-loggers -h 192.168.2.1:8778http://192.168.2.1:8778/ROOTmeme.ivanyume.ivanyu.agenthostme.ivanyu.agenthost.App```### Getting the logging levelTo get the logging levels use `get` command:```bashjloglevelget−h192.168.2.1:8778−h192.168.2.2:8778−h192.168.2.3:8778LoggerROOThttp://192.168.2.1:8778/DEBUGhttp://192.168.2.2:8778/DEBUGhttp://192.168.2.3:8778/DEBUG‘‘‘Bydefault,theloggeris‘ROOT‘.Youcangetthelogginglevelofanotherloggerusing‘−l/−−logger‘option:‘‘‘bash jloglevel get -h 192.168.2.1:8778 -l me.ivanyu.testapp.AppLogger me.ivanyu.testapp.Apphttp://192.168.2.1:8778/ DEBUG```### Setting the logging levelTo set the logging levels use `set` command:```bashjloglevelset−h192.168.2.1:8778−h192.168.2.2:8778−h192.168.2.3:8778TRACELoggerROOThttp://192.168.2.1:8778/OKhttp://192.168.2.2:8778/OKhttp://192.168.2.3:8778/OK‘‘‘Startingfromthismoment,theloggingleveloftheROOTloggeris‘TRACE‘.Aswith‘get‘command,youcanspecifyaloggerdifferentfromthedefault‘ROOT‘using‘−l/−−logger‘option:‘‘‘bash jloglevel set -h 192.168.2.1:8778 -l me.ivanyu.testapp.App TRACELogger me.ivanyu.testapp.Apphttp://192.168.2.1:8778/ OK```## Authors and ContributorsThe project is started and maintained by [Ivan Yurchenko](https://ivanyu.me/) (ivan0yurchenko@gmail.com).Contributions are welcome!## License```Copyright 2017 Ivan YurchenkoLicensed under the Apache License, Version 2.0 (the "License");you may not use this file except in compliance with the License.You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License.```

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.