no date in mac osx logfile?


(SiSa) #1

Not sure, if this is an issue, I can fix myself while changing something anywhere on the mac, so I’d like to ask the reason, why there is no date in the logfile syncthing.log

[BCQRP] 15:22:33 INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
[BCQRP] 15:22:33 INFO: Exiting
[BCQRP] 15:32:07 INFO: syncthing v1.0.1 "Erbium Earthworm" (go1.11.5 darwin-amd64) teamcity@build.syncthing.net 2019-01-18 10:34:18 UTC

I expected something like

2019-02-09 17:12:27.472  INFO: Relay listener (dynamic+https://relays.syncthing.net/endpoint) shutting down
2019-02-09 17:12:27.472  INFO: Exiting
2019-02-09 17:12:27.472  INFO: syncthing v1.0.1 "Erbium Earthworm" (go1.11.5 darwin-amd64) teamcity@build.syncthing.net 2019-01-18 10:34:18 UTC

If there is something, I can change, please point me to it, if not, would it be possible to add the date to the log?

(I’m running Mac OS X High Sierra 10.12.6)


#2

I don’t know how you create the log file, but normally the “log” is the console output and there the date isn’t important, as you won’t scroll back a whole day :wink:

You can set the -logflags=7 parameter. Then the log will have:

 2019/02/12 21:06:00.270854 INFO:

(SiSa) #3

Thanks,

I guess, I followed this HowTo by @calmh

I have checked the debugging help, but, well, I guess, I am missing something…

Where would I add the logflags ?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>net.syncthing.syncthing</string>
        <key>ProgramArguments</key>
        <array>
                <string>/Applications/syncthing</string>
        </array>
        <key>EnvironmentVariables</key>
        <dict>
                <key>HOME</key>
                <string>/Users/user</string>
                <key>STNORESTART</key>
                <string>1</string>
        </dict>
        <key>KeepAlive</key>
        <true/>
        <key>LowPriorityIO</key>
        <true/>
        <key>ProcessType</key>
        <string>Background</string>
        <key>StandardOutPath</key>
        <string>/Users/user/Library/Logs/Syncthing.log</string>
        <key>StandardErrorPath</key>
        <string>/Users/user/Library/Logs/Syncthing-Errors.log</string>
</dict>
</plist>

#4

I have no clue :slight_smile:


(Audrius Butkevicius) #5

It has to be on the command line


(SiSa) #6

Thanks,

so, in my case, I cannot change the logflags, because syncthing is started via LaunchDaemon?


(Jakob Borg) #7

Parameters for that are set in the launchd plist file. Add a <string> in the ProgramArguments array. Launchd isn’t particularly user friendly, but it is what it is.


(SiSa) #8

Thanks!

Now it is so much more better to read for me.

[BCQRP] 21:55:47 INFO: Exiting
[BCQRP] 2019/02/12 21:57:43.791310 INFO: syncthing v1.0.1 "Erbium Earthworm" (go1.11.5 darwin-amd64) teamcity@build.syncthing.net 2019-01-18 10:34:18 UTC

I have changed this part of my plist, as suggested:

    <key>ProgramArguments</key>
    <array>
            <string>/Applications/syncthing</string>
            <string>-logflags=7</string>
    </array>

(system) closed #9

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.