Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is it possible to show logs from scripts in Scriptrunner console without collecting them ?


I sometimes generate long lists of log statements, while debugging scripts used to extract data from spaces, pages, etc... 

These are all collected in the atlassian.confluence.log, as I see.

I'm starting to define a specific logger, for later easier reading, but in some cases I'd like to not have those logs recorded at all.

Is there a way to keep seeing them in the console, without writing them in the log file?

The idea is to avoid this log file getting bigger and bigger.


Below an example code, which I'd like to modify obtaining only console viewing


import org.apache.log4j.Logger
import org.apache.log4j.Level

def myLog = Logger.getLogger("Testing Logger")

myLog.debug("Starting ...")

//Do something

myLog.debug ("Finished.")


Another idea I had in mind was to actually append the log lines as strings in a simple text file to be placed where I want, instead of using the real logger, but I'd like to keep the console visualizazion.

Thanks in advance for any hint.

Ciao, Andrea

1 answer

1 accepted

0 votes
Answer accepted

Instead of logging, you could put the "log" messages into a variable, then use "return" at the end to display the contents of the variable.  They will appear in the Console's Result tab instead of the Log tab.

This would allow you to keep your "console visualization." 

Each time you run the script in the Console, though, the Result tab will reset with the new results.  So, be sure you really don't want to keep the results.

You can use HTML tags to format your output, too.

For example:

String results = "<p>Starting ...</p>"

//Do something

results += "<p>Finished.</p>"

return results

However, if you've got a TON of data that you're logging with one run of the script, you probably do want to somehow put the results in another format.  The Console Result screen does have a limit as to how many lines it can handle before it misbehaves.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

🏠 Say hello to the new Confluence Home!

Hi Atlassian Community, My name is DJ Chung, and I’m a Product Manager on the Confluence Cloud team. Today, I’m excited to share a new and improved version of Home. The new Home helps you ...

985 views 7 42
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you