Mastering JBoss Enterprise Application Platform 7 by Francesco Marchioni & Luigi Fugaro

Mastering JBoss Enterprise Application Platform 7 by Francesco Marchioni & Luigi Fugaro

Author:Francesco Marchioni & Luigi Fugaro [Marchioni, Francesco]
Language: eng
Format: azw3
Publisher: Packt Publishing
Published: 2016-08-31T04:00:00+00:00


Reading logs with management interfaces

Log files can also be read or downloaded with the management interfaces of the application server. This is quite useful if you don't have an operating system account for inspecting your log files.

You have multiple options for reading logs with management interfaces. We will show at first how to do it with the CLI; next, we will use the REST services of the administration console to read it from a common browser.

Reading logs from the CLI

The logging subsystem includes a log-file resource that can be used to read the list of log files that have been created:

/subsystem=logging:read-children-names(child-type=log-file) { "outcome" => "success", "result" => [ "server.log", "server.log.2015-02-12", "server.log.2015-02-13" ] }

If you want to inspect a single log file, then you can use the read-log-file operation which is available on each log-file resource:

/subsystem=logging/log-file=server.log:read-log-file { "outcome" => "success", "result" => [ "2016-02-08 12:09:50,386 INFO [org.infinispan.configuration.cache.EvictionConfigurationBuilder] (ServerService Thread Pool -- 58) ISPN000152: Passivation configured without an eviction policy being selected. Only manually evicted entities will be passivated.", "2016-02-08 12:09:51,004 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 62) WFLYCLINF0002: Started routing cache from web container", "2016-02-08 12:09:51,398 INFO [org.wildfly.extension.undertow] (ServerService Thread Pool -- 58) WFLYUT0021: Registered web context: /web", "2016-02-08 12:09:51,453 INFO [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0010: Deployed "web.war" (runtime-name : "web.war")", "2016-02-08 12:09:51,585 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management", "2016-02-08 12:09:51,586 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990", "2016-02-08 12:09:51,587 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: EAP 7.0.0.Beta1 (WildFly Core 2.0.3.Final-redhat-1) started in 6393ms - Started 373 of 601 services (354 services are lazy, passive or on-demand)" ] }

The read-log-file operation accepts the following parameters:

encoding: The encoding the file should be read in.

lines: The number of lines from the file. A value of -1 indicates all lines should be read.

skip: The number of lines to skip before reading.

tail: True to read from the end of the file up or false to read from the top down.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.