View logs online - system info - log file paths

Martin Fischer January 6, 2021

Hello, is there any request for an rest endpoint that would provide full details similar to the "System info" admin section of JIRA ( (/rest/api/2/serverInfo provides very limited information)? Or a different way how to retrieve the log files paths? 

I'd like to do my own plugin logs "online" viewer kind of thing. I know there are some free apps you can find on Marketplace or there is even some built-in script in ScriptRunner for Jira but I'd like to make one for my concrete type of scenario. 

I thought it could work in the very simplicity - open the log file, read few lines of it and show that in some dialog. 

2 answers

0 votes
Kristian Walker _Adaptavist_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 6, 2021

Hi Martim.

I can confirm that ScriptRunner for Jira Server/ Data Center provides the built in script named View Server Log Files which is documented here and when you run this script then you can specify a log file as well as how many lines you want to view from this and this will be displayed online inside of Jira.

I hope this helps.

Regards,

Kristian

0 votes
Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2021

Nope, the API endpoints would be listed here: https://developer.atlassian.com/server/jira/platform/rest-apis/

 

For anything more "custom" you would have to improvise a little bit with HTTP requests and perhaps filtering the content out from either html or json.

 

If you would be building a plugin you can however use Java API which definitely will allow you to get that data, including the file system path to the log files.

Radek Dostál
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 6, 2021

Anyway if you want to view logs "online" you don't need a plugin per se, you can just configure the web server to serve static content (e.g. like for Apache here: https://access.redhat.com/solutions/67298). May want to be very sure that the folder won't be accessible to unwanted parties though since static content will follow web server configuration, and will be "outside" of Jira application entirely.

Martin Fischer January 7, 2021

Thanks for your response. Even tough it's an interesting solution I'd like to have the viewer within the plugin itself as a part of the plugin functionality. Probably will go with the Java API recomendation. 

Suggest an answer

Log in or Sign up to answer