# Reporting: Logging does not work inside chart script

**URL:** <https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333>\
**Category:** Ignition\
**Created:** [October 5, 2026, 3:26pm UTC](https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333 "2026-10-05T15:26:19Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![eaolson](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eaolson](https://forum.inductiveautomation.com/u/eaolson)\
**Post date:** [October 5, 2026, 3:26pm UTC](https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333/1 "2026-10-05T15:26:19Z")

</div>

I was trying to add an `IntervalMarker` to a chart in a report and move that to the background layer. I was having some difficulty. I think exceptions get captured and silently discarded in those scripts. After adding some of the usual system logger calls (`system.util.getLogger`), I found those do work there. Nothing shows up in the log page. I even tried plain old `print` statements, hoping they would wind up in the wrapper.log file, but got nothing. I finally had to make `system.file.writeFile` calls to a temporary file to get any output.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 5, 2026, 3:58pm UTC](https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333/2 "2026-10-05T15:58:31Z")

</div>

Show your code. Jython doesn't catch java errors in `try:` − `except Exception, e:` constructs.

---

<div class="post-metadata">

**Author:** ![eaolson](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eaolson](https://forum.inductiveautomation.com/u/eaolson)\
**Post date:** [October 5, 2026, 4:13pm UTC](https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333/3 "2026-10-05T16:13:26Z")

</div>

My now-working script looks like this:

```python
def configureChart(data, chart):
	from org.jfree.chart.renderer.xy import XYStepRenderer
	from org.jfree.chart.plot import IntervalMarker
	from org.jfree.ui import Layer
	from java.awt import BasicStroke, Color
	
	plot = chart.getPlot()
	renderer = XYStepRenderer()
	renderer.setStroke(BasicStroke(2.0))
	renderer.setSeriesPaint(0, Color.decode("#4269D0"))
	plot.setRenderer(0, renderer)
	
	logger = system.util.getLogger("chart")
	logger.error("No error, starting chart")
	markerStart = data["waterAddedData"]["fillStartTime"].getTime()
	markerEnd = data["waterAddedData"]["fillEndTime"].getTime()
	intervalMarker = IntervalMarker(markerStart, markerEnd)
	intervalMarker.setPaint(Color.decode("#CCCCCC"))
	plot.addDomainMarker(intervalMarker, Layer.BACKGROUND)

```

Even using the error level, nothing gets put into the logs. No logger named "chart" appears in the list of loggers.

My original problem was using `from org.jfree.chart.ui import Layer`, but it looks like Ignition is using the 1.0 branch of JFreeChart, where Layer is in org.jfree.ui. It never occurred to me to put the import statements inside the try block (legal in Jython, not legal in Java), so there was probably an uncaught exception being raised, but it isn't visible anywhere in the Designer or the logs

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [October 5, 2026, 4:20pm UTC](https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333/4 "2026-10-05T16:20:11Z")

</div>

1. Move your code to a project library script, and move all imports **outside** the `def`, along with the creation of the `logger` object (so it is persistent).

2. In the first line inside the `def`, invoke the logger.

3. Ideally, nest all the rest of the code in a double-except `try:` construct, so you can log both java and jython errors. Something like this:

> [@Database connection Faulted - Errors list](https://forum.inductiveautomation.com/t/database-connection-faulted-errors-list/115944/3):
>
> There's no fixed list, as different JDBC drivers all have there own error messages. Also, the only reliable point to trap errors is in scripted calls to perform database operations, where you use a double except clause. Something like this in a project library script: from java.lang import Throwable def someProcessingFunction(someArgument): # .... try: result = system.db.runPrepQuery(....) except Throwable, t: # handle java and jdbc errors here except Exceptio…

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 5, 2026, 4:35pm UTC](https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333/5 "2026-10-05T16:35:37Z")

</div>

> [@eaolson](#):
>
> there was probably an uncaught exception being raised, but it isn't visible anywhere in the Designer or the logs

Report errors at design time are raised and caught in the designer, so they show up in the output console:

 ![Screenshot 2026-10-05 at 9.33.18 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/4/3/43e11ef7c0446fc080476510ed1767fd4190d3af.png)

If you actually run the report on the gateway, e.g. by executing a schedule directly, you get an error in the logs:

 ![Screenshot 2026-10-05 at 9.35.25 AM](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/4/54fa8272ab330625cef553515b600708d95a3398.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [October 5, 2026, 4:42pm UTC](https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333/6 "2026-10-05T16:42:30Z")

</div>

To preempt a possible question - errors in the designer are not raised more visibly because report generation is being run directly on the painting thread - the report preview is a live preview using Swing objects. If we raised those errors to ErrorUtil, you'd be getting a constant flood of errors as repaint operations run and cause your chart(s) with issues to run their repaint methods that are broken.

---

<div class="post-metadata">

**Author:** ![eaolson](https://avatars.discourse-cdn.com/v4/letter/e/f07891/32.png) [@eaolson](https://forum.inductiveautomation.com/u/eaolson)\
**Post date:** [October 5, 2026, 4:57pm UTC](https://forum.inductiveautomation.com/t/reporting-logging-does-not-work-inside-chart-script/117333/7 "2026-10-05T16:57:12Z")

</div>

> [@paul-griffith](#):
>
> Report errors at design time are raised and caught in the designer, so they show up in the output console:

This is the answer. I don't know why I didn't think to check the output console.
