# Viewing Downloaded Logs

**URL:** <https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [April 14, 2017, 8:32pm UTC](https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060 "2017-04-14T20:32:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [April 14, 2017, 8:32pm UTC](https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060/1 "2017-04-14T20:32:40Z")

</div>

In Ignition 7.9.x the log files are now exported as an .idb file.  
Since I have some systems and clients that do not give me access to the file system so I can get the wrapper log.  
What application am I supposed to use to read the contents of the .idb file?

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 14, 2017, 8:34pm UTC](https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060/2 "2017-04-14T20:34:12Z")

</div>

It’s just a sqlite DB, so you can use any utility you want that can understand it. Not that looking at a DB full of log entries is very useful…

---

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [April 14, 2017, 8:46pm UTC](https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060/3 "2017-04-14T20:46:57Z")

</div>

So lets say I grab [http://sqlitebrowser.org/](http://sqlitebrowser.org/) which sounds like it would work if it’s a sqlite DB.  
But it doesn’t recognize .idb as a file type it can use.

Furthermore, [https://www.file-extensions.org/idb-file-extension-idea-database-file](https://www.file-extensions.org/idb-file-extension-idea-database-file) the file is for some outdated software.  
The software from here: [http://www.sycon.de/eng/index.htm](http://www.sycon.de/eng/index.htm) does not work to open it.

Do you have a suggestion for a utility that can understand it?

---

<div class="post-metadata">

**Author:** ![mazeyrat](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/mazeyrat/32/10955_2.png) [@mazeyrat](https://forum.inductiveautomation.com/u/mazeyrat)\
**Post date:** [April 14, 2017, 8:55pm UTC](https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060/4 "2017-04-14T20:55:48Z")

</div>

the extension is not important, in the file open dialog chose _._ if possible or change the extension of your db file with an extension sqlitebrowser support.  
You can use as well [https://sqlitestudio.pl](https://sqlitestudio.pl)

---

<div class="post-metadata">

**Author:** ![matt.eaton](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matt.eaton/32/72046_2.png) [@matt.eaton](https://forum.inductiveautomation.com/u/matt.eaton)\
**Post date:** [April 14, 2017, 8:57pm UTC](https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060/5 "2017-04-14T20:57:58Z")

</div>

I wouldn’t have guessed it, but it works if you just load it anyway. Thanks.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [April 14, 2017, 9:13pm UTC](https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060/6 "2017-04-14T21:13:37Z")

</div>

I’m using the tool from [http://sqlitebrowser.org/](http://sqlitebrowser.org/)

---

<div class="post-metadata">

**Author:** ![mpderbec](https://avatars.discourse-cdn.com/v4/letter/m/bbe5ce/32.png) [@mpderbec](https://forum.inductiveautomation.com/u/mpderbec)\
**Post date:** [October 6, 2017, 3:16am UTC](https://forum.inductiveautomation.com/t/viewing-downloaded-logs/14060/7 "2017-10-06T03:16:17Z")

</div>

I wrote a quick Python function to dump the IDB to a typical-looking log file:

```auto
import sqlite3
from datetime import datetime

def dump(idb_file, logger_name, output_file):
    """
    Dump an Ignition SQLite log database to file in typical log file format.
    
    :param idb_file: .idb file to dump
    :param logger_name: logger name (package) to filter on
    :param output_file: path for output text file
    """
    try:
        connection = sqlite3.connect(idb_file)
        cursor = connection.cursor()
        pattern = logger_name + '.%'
        rows = cursor.execute('SELECT level_string, timestmp, thread_name, logger_name, formatted_message '
                              'FROM logging_event WHERE logger_name LIKE "%s" ORDER BY timestmp' % pattern)

        count = 0
        with open(output_file, 'w') as f:
            for row in rows:
                count = count + 1
                (level_string, timestmp, thread_name, logger_name, formatted_message) = row
                time_string = datetime.fromtimestamp(timestmp / 1000.0)
                f.write(
                    '%-5s %s [%s] %s %s\n' % (level_string, time_string, thread_name, logger_name, formatted_message))

        print 'From "%s", wrote %d lines to "%s"' % (idb_file, count, output_file)

    finally:
        connection.close()

```
