Show Log

Last modified by Ricardo Rodríguez on 2026/08/05 17:14

application_osx_terminalShows the xwiki log file content using Groovy
TypeSnippet
Category
Developed by

Vincent Massol

Rating
1 Votes
LicenseGNU Lesser General Public License 2.1

Table of contents

Description

{{groovy}}
if (request.lines) {
  lines = request.lines;
} else {
  lines = 3000;
}
if (request.xpage == "plain" && request.showlog == "1") {
  print "{{code language='none'}}"
  line = "tail -n " + lines + " catalina.out"
  print(line.execute().getText())
  print "{{/code}}"
}
{{/groovy}}
[[ShowLog>>?xpage=plain&showlog=1]]

Get Connected