Viewing Downloaded Logs

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?

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…

So lets say I grab 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 the file is for some outdated software.
The software from here: 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?

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

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

I’m using the tool from http://sqlitebrowser.org/

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

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()
4 Likes