# Scripting to read gateway logs

**URL:** <https://forum.inductiveautomation.com/t/scripting-to-read-gateway-logs/64402>\
**Category:** Ignition\
**Tags:** scripting\
**Created:** [September 23, 2022, 4:30am UTC](https://forum.inductiveautomation.com/t/scripting-to-read-gateway-logs/64402 "2022-09-23T04:30:49Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![kgamble](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kgamble/32/8019_2.png) [@kgamble](https://forum.inductiveautomation.com/u/kgamble)\
**Post date:** [September 23, 2022, 3:48pm UTC](https://forum.inductiveautomation.com/t/scripting-to-read-gateway-logs/64402/7 "2022-09-23T15:48:51Z")

</div>

Ahh, that does the trick.

### Code for prosperity

```python
from com.inductiveautomation.ignition.gateway import IgnitionGateway
from com.inductiveautomation.ignition.common.logging import LogQueryConfig
	
loggingManager = IgnitionGateway.get().getLoggingManager()
	
queryFilter = LogQueryConfig.newBuilder().build()
	
logResults = loggingManager.queryLogEvents(queryFilter)
	
events = logResults.getEvents()
	
system.perspective.print(events)

```

I did notice this documentation error for the [LogQueryConfig](https://files.inductiveautomation.com/sdk/javadoc/ignition81/8.1.20/com/inductiveautomation/ignition/common/logging/LogQueryConfig.html) it states the following:

> A set of parameters for querying the logging system. Can be created by hand, or with LogQueryConfigBuilder.newBuilder() (the preferred method)

But it seems that the `newBuilder` method isn't valid for LogQueryConfigBuilder, instead it should be `LogQueryConfig.newBuilder()`

---

_[View the full topic](https://forum.inductiveautomation.com/t/scripting-to-read-gateway-logs/64402)._
