Feature #72 - Logging to file
Google user: nick.bolton.uk
As defined in ["/p/synergy-plus/wiki/SpecAnalysis":SpecAnalysis #Logging the specification], there are a number
of different log outputters, however, there appears to be no method of
logging to a specified file.
It may be useful for end users, to specify a system file to which Synergy+
should output in the synergyc and synergys command line argyments.
Of course, it is necessary on Unix to run, say, synergyc in foreground mode
(but in the background) and direct the output to a log file.
synergyc -f my-server > synergyc.log 2>&1
This approach does however require a slightly more in depth understanding
of the Linux command line, which not all users are interested in learning.
#1
Google user: nick.bolton.uk
Corrections:
The wiki URL intended was:
"http://code.google.com/p/synergy-plus/wiki/SpecAnalysis#Logging":http://code.google.com/p/synergy-plus/wiki/SpecAnalysis#Logging
The example command to run synergyc in the backrgound with logging is incorrect;
while it does redirect the output, it does not run the process in the background. To
do this, an additional ampersand must be added.
synergyc -f my-server > synergyc.log 2>&1&
The behaviour to implement should be as similar to this as possible; the user must be
able to use the following command to follow the output:
tail -f synergyc.log
#2
Google user: nick.bolton.uk
The argument syntax should be like so:
synergyc -l synergyc.log my-server
Where -l is the "log to file" argument, and synergyc.log is a user specified log file
name.
#3
Google user: nick.bolton.uk
Moving this up to high priority as it will improve development efficiency.
#4
Google user: nick.bolton.uk
Me and Sorin agree that this will be useful for debugging when running as Windows
service. The stderr stream may not be flexible enough.
#5
Google user: nick.bolton.uk
It may also be a good idea to have the Windows GUI console window read the contents
of this file every 1 second, instead of writing to the text box directly.
#6
Google user: nick.bolton.uk
This would apply to both client and server:
- synergyc
- synergys
#7
Google user: edw...@carrel.org
Here's a completely random thought?
Have we considered substituting in a third-party logging library for our internally
rolled logging system? It would be one less thing we would have to extend and
maintain ourselves. shrug
#8
Google user: nick.bolton.uk
Cool. What ideas for libs did you have? What would be the advantages over a flat file?
#10
Google user: ad...@mar.lt
I made a patch for logging to files.
I added -l
It patches both synergys and synergyc. I've created logger in mainLoop(), maybe it
needs some refactoring?
It's my first patch for OS project, so check it carefully.
Thanks.
#11
Google user: ad...@mar.lt
Made some changes to prev. diff to match
"http://code.google.com/p/synergy-plus/wiki/Specification":http://code.google.com/p/synergy-plus/wiki/Specification
#12
Google user: syed.a...@gilani.eu
Patch applied to main branch.
Please post feedback.
#13
Google user: nick.bolton.uk
Works nicely for me - thanks patch author!
#16
Backported to see if this would help diagnose #2689 but it doesn't have times! So that's probably the next step (to add times to log messages).
TODO: See if newer version has times in the log file, and if it does, backport that issue. Otherwise create a new issue for this purpose, and implement in all versions.
Write comment