Code Monkey home page Code Monkey logo

sblm-cli's Introduction

SBLM CLI

Spring Boot Logger Manager CLI.

Screenshot

Usage

In general, it is encouraged to follow the guidelines of the CLI.

foo@bar:~$ sblm-cli -h

This CLI allows to users to list or edit the Spring Boot logger from any online Spring Boot application.

Usage:
  sblm-cli [command]

Available Commands:
  edit        It edits the logger level of a logger or set of loggers
  help        Help about any command
  list        List all loggers from the APP

Flags:
  -a, --app string       Application to get information (default "HelloWorld")
  -h, --help             help for sblm-cli
  -p, --pattern string   Pattern to be applied (default "$server/$app/actuator/loggers")
  -s, --server string    Server to get information (default "http://localhost:8080")
  -v, --verbose          verbose output

Use "sblm-cli [command] --help" for more information about a command.

List loggers

To list all the available loggers

foo@bar:~$ sblm-cli list --server <YOUR_SERVER> --app <YOUR_APP> --filter <YOUR_FILTER>

This command makes, by default, a GET request to:

<YOUR_SERVER>/<YOUR_APP>/actuator/loggers

For example:

http://localhost:8080/HelloWorld/actuator/loggers

The result is filtered by the group provided.

Edit loggers

To edit a group of the available loggers

foo@bar:~$ sblm-cli edit --server <YOUR_SERVER> --app <YOUR_APP> --name <YOUR_LOGGER_GROUP> --level <OFF|ERROR|WARN|INFO|DEBUG|TRACE>

This commands makes, by default, a POST request to:

<YOUR_SERVER>/<YOUR_APP>/actuator/loggers/<YOUR_LOGGER_GROUP>

For example:

http://localhost:8080/HelloWorld/actuator/loggers/org.springframework.web.server

Aditionally sends, by POST parameter a JSON like that:

"org.springframework.web.server": {
    "configuredLevel": "DEBUG"
}

Tricks

  • In the logger list, if you need to do some grep with the data returned by the command please use the raw (-r or --raw) option to get a more flat list.
  • If you need more debugging information about the internal use of the tool, please use the verbose (-v or --verbose) option.
  • If you are working on a local environment probably you won't have any context path. In this case you could change the endpoint format setting the pattern (-p or --pattern) option to something like $server/actuator/loggers.

Building SBLM-CLI

Just execute go build on the root path and get the binary!

Architecture

Sorry, this software has been done in only one day! No testing, no good architecture, ... maybe in future versions.

sblm-cli's People

Contributors

datoga avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.