JIRA plugin logging - JavaScript

Martin Fischer December 21, 2020

Hello, I'm trying to figure out how to do some logging (in plugin) in the right JIRA way (if it is possible) through JavaScript.  As I understood Jira uses the log4j logging module (with ViewLogging.jspa where you can set logging level). Is there any simple and effective way how to achieve this kind of functianility ("communication" wih ViewLogging.jspa page) from js? Or are there any ways how to do the logging from js (ideally in a way it could be accessible via GUI)?

Thank you for your ideas.

1 answer

1 accepted

0 votes
Answer accepted
Nic Brough -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.
December 21, 2020

The logging and the javascript are done in different places, so you'll need to think about how those two parts talk to each other.

You're right about log4j logging inside Jira, you can (and should, because it's built in and pretty standard) use that to record what you need to.  But you're going to need to think about how your plugin gets stuff to log from the javascript.

Javascript is run on the user's machine in the browser.  So if you are trying to log what it's doing there, you'll need to think about how the javascript feeds the information back to your plugin in Jira so it can be written.  Most javascript doesn't bother logging in this way, it's used to present stuff to people and then poke the server to do things, and it's usually the "do things" that people are interested in logging, not the js on the browser.

Suggest an answer

Log in or Sign up to answer