{ "info": { "author": "Ivan Yurchenko", "author_email": "ivan0yurchenko@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: MacOS", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: Unix", "Programming Language :: Python :: 3.0", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development" ], "description": "# jloglevel\n\n[![Build Status](https://travis-ci.org/ivanyu/jloglevel.svg?branch=master)](https://travis-ci.org/ivanyu/jloglevel)\n\n`jloglevel` is a command line tool for changing the logging level in JVM apps in runtime via [Jolokia](https://jolokia.org/).\n\n## How it works\n\nJVM 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.\n\nJVM 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.\n\nJMX 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.\n\nCombining 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).\n\nCurrently, only [Logback](https://logback.qos.ch/) library is supported.\n\n## Installation\n\n```bash\n$ pip3 install jloglevel\n```\n\n## Usage prerequisites\n\n1. Jolokia agent needs to be attached to a JVM (or JVMs) you are going to work with. Follow the [Jolokia documentation](https://jolokia.org/documentation.html) for the details.\n\n2. Logback must be configured to expose its control via JMX.\nTechnically only `` needs tp be added to `logback.xml`. See [JMX Configurator page](https://logback.qos.ch/manual/jmxConfig.html) in the documentation for the details.\n\n## Usage \n\n### Common options\n\nThere are two common options in every command:\n\n`-h` or `--host` to specify the IP address and the port where Jolokia agent is listening for incoming connections. Can be multiple. _Example:_ `-h 192.168.2.1:8778 -h 192.168.2.2:8778 -h 192.168.2.3:8778`\n\n`--socks5` for specifying the SOCKS5 proxy IP address and port (if needed). _Example_: `--socks5 127.0.0.1:9999`\n\nThis might be useful with SSH.\n\n### Listing all loggers\n\nTo list the loggers use `list-loggers` command:\n\n```bash\n$ jloglevel list-loggers -h 192.168.2.1:8778\n\nhttp://192.168.2.1:8778/\nROOT\nme\nme.ivanyu\nme.ivanyu.agenthost\nme.ivanyu.agenthost.App\n```\n\n### Getting the logging level\n\nTo get the logging levels use `get` command:\n\n```bash\n$ jloglevel get -h 192.168.2.1:8778 -h 192.168.2.2:8778 -h 192.168.2.3:8778\n\nLogger ROOT\nhttp://192.168.2.1:8778/\tDEBUG\nhttp://192.168.2.2:8778/\tDEBUG\nhttp://192.168.2.3:8778/\tDEBUG\n```\n\nBy default, the logger is `ROOT`. You can get the logging level of another logger using `-l/--logger` option:\n\n```bash\n$ jloglevel get -h 192.168.2.1:8778 -l me.ivanyu.testapp.App\n\nLogger me.ivanyu.testapp.App\nhttp://192.168.2.1:8778/\tDEBUG\n```\n\n### Setting the logging level\n\nTo set the logging levels use `set` command:\n\n```bash\n$ jloglevel set -h 192.168.2.1:8778 -h 192.168.2.2:8778 -h 192.168.2.3:8778 TRACE\n\nLogger ROOT\nhttp://192.168.2.1:8778/\tOK\nhttp://192.168.2.2:8778/\tOK\nhttp://192.168.2.3:8778/\tOK\n```\n\nStarting from this moment, the logging level of the ROOT logger is `TRACE`.\n\nAs with `get` command, you can specify a logger different from the default `ROOT` using `-l/--logger` option:\n\n```bash\n$ jloglevel set -h 192.168.2.1:8778 -l me.ivanyu.testapp.App TRACE\n\nLogger me.ivanyu.testapp.App\nhttp://192.168.2.1:8778/\tOK\n```\n\n## Authors and Contributors\n\nThe project is started and maintained by [Ivan Yurchenko](https://ivanyu.me/) (ivan0yurchenko@gmail.com).\n\nContributions are welcome!\n\n## License\n\n```\nCopyright 2017 Ivan Yurchenko\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ivanyu/jloglevel", "keywords": "jmx jolokia logging jvm", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "jloglevel", "package_url": "https://pypi.org/project/jloglevel/", "platform": "", "project_url": "https://pypi.org/project/jloglevel/", "project_urls": { "Homepage": "https://github.com/ivanyu/jloglevel" }, "release_url": "https://pypi.org/project/jloglevel/0.1.4/", "requires_dist": null, "requires_python": "", "summary": "A command line tool for changing the logging level in JVM apps in runtime via Jolokia", "version": "0.1.4" }, "last_serial": 3263537, "releases": { "0.1.3": [ { "comment_text": "", "digests": { "md5": "27c7a14c480dd096e0ccdcaf8abf393b", "sha256": "bd96c7178d4a35721cf0c0dab59271a2930b0964e6fedf3fcd2a81bfdaba6f6f" }, "downloads": -1, "filename": "jloglevel-0.1.3.tar.gz", "has_sig": false, "md5_digest": "27c7a14c480dd096e0ccdcaf8abf393b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8080, "upload_time": "2017-10-18T17:12:15", "url": "https://files.pythonhosted.org/packages/b5/77/3c56432d81ed12e7c9c5bd0dfa94360152bc3c507c5af553d1f6c86a2614/jloglevel-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "f91667a2d5e37f68431b2c8fb9c173fd", "sha256": "f4936ac39f291272db738a39e2fdfa1cc3324128fabc5fdbbf9983b5ca1f09be" }, "downloads": -1, "filename": "jloglevel-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f91667a2d5e37f68431b2c8fb9c173fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8845, "upload_time": "2017-10-19T17:21:14", "url": "https://files.pythonhosted.org/packages/e2/77/0c686af6c26a1c589e1fb5b145ff7bf0bf2816b2179e839c83bf513b0fac/jloglevel-0.1.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f91667a2d5e37f68431b2c8fb9c173fd", "sha256": "f4936ac39f291272db738a39e2fdfa1cc3324128fabc5fdbbf9983b5ca1f09be" }, "downloads": -1, "filename": "jloglevel-0.1.4.tar.gz", "has_sig": false, "md5_digest": "f91667a2d5e37f68431b2c8fb9c173fd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8845, "upload_time": "2017-10-19T17:21:14", "url": "https://files.pythonhosted.org/packages/e2/77/0c686af6c26a1c589e1fb5b145ff7bf0bf2816b2179e839c83bf513b0fac/jloglevel-0.1.4.tar.gz" } ] }