Will manual logging work on Linux Ignition as well?

hi All
Sometimes i would like to use super simple custom manual logging:

def logging(msg):
f = open(“C:\PROJECTS\IgnitionManualLoggings.txt”,“a”)
now = system.date.now()
m = “(” + str(now) + ") " + msg + “\n”
f.write(m)
f.close()

I just checked and the script creates a file if it does not exist.
I wonder if this will work on linux as well with its different file system ?

If you give it a valid filename for linux, and the ignition service has privileges in that folder, yes.

1 Like

thanks a lot Phil - do you know if there is a way to check Ignition installation folder in scripting? Having this path i could just add file name and as you said if permission are right -it should work :slight_smile:

If you’ve installed Ignition as a service, you should be able to use a relative path to target the Ignition installation folder. For example, open("foo.txt", "a") in gateway scope would append to a file at <Ignition Install Location>/foo.txt.

1 Like

Hi Kevin
Just wonder if i am not understanding something fundamental.
When doing the simplest type of install (shown in the training on inductiveuniversity) is ignition installed as a service as well? to me this means it starts after operating system starts and does things in the background before somebody launches client and triggers other functionality or did you mean anything else?

Correct, typical install will have Ignition setup as a service… The gateway will start in the background, independent of any Client/Designer connections you would typically launch later.

1 Like