PowerPing icon indicating copy to clipboard operation
PowerPing copied to clipboard

Log to file

Open n3t opened this issue 5 years ago • 9 comments

Hi,

I tried to redirect stdoutput to file like this powerping 127.0.0.1 > test.log It stores the file correctly, however the process ends up with an exception

Unhandled exception: System.IO.IOException: The handle is invalid.

   v System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   v System.Console.set_CursorVisible(Boolean value)
   v PowerPing.Program.Main(String[] args)

However, would be nice to have option to store some log file, even, for example, when using graph. So I can have graph on the screen and detailed log in file.

Pavel

n3t avatar Mar 17 '20 12:03 n3t

Good idea, I think this is an especially important feature if normal pipe redirection is broken. I will see if I can add this to the next release.

Killeroo avatar Mar 17 '20 18:03 Killeroo

Thanks :)

n3t avatar Mar 17 '20 18:03 n3t

@n3t This exception is now fixed in the latest release (download it here), PowerPing's output should be able to piped to a file or just generally have it's output redirected without producing an error.

I still like the idea of maybe writing to a log file while still outputting to the console so will look to add that in the next big release.

Killeroo avatar Sep 17 '20 19:09 Killeroo

May I add that additionally to redirection a proper (e.g. CSV formatted) log file would be greatly appreciated. I am thinking of the use-case to monitor for quite some time and to analyse statistics afterwards... Here, a CSV file would be perfect.

Thank you!

MortenMacFly avatar Apr 02 '21 19:04 MortenMacFly

Good idea @MortenMacFly, I have bumped it to the top of my todo list for the next release 👍

Killeroo avatar Apr 02 '21 23:04 Killeroo

Nice, glad you like it. BTW: The coloured output is extremely helpful compared to standard-ping!

MortenMacFly avatar Apr 03 '21 04:04 MortenMacFly

I could not get this to output to a file.... what am I missing?

powerping --fulltimestamp -infinite www.google.com > testping.txt

i should add it created the file but it was empty. I did have to use CTRL-C to stop as i am using infinite.

asjones987 avatar Aug 23 '21 21:08 asjones987

@asjones987 Your arguments seem fine, I tried it out locally and did manage to get it to work. I found that initially it seemed like it wasn't working until I specified the full path of the log file (... > E:\testping.txt), then it seemed to start working again even without the full path.

But the argument is valid so I am not quite sure why it might not be working.

Killeroo avatar Aug 25 '21 09:08 Killeroo

ooops i forgot to respond.... i found that if i run a comment prompt as Admin then I don't have the issue. The only side issue still is one does not get to see anything on the screen while it is running.

Ideally it would be nice if instead of having to redirect to a file there was a parameter like -File:<path/name> that would write to a file and also have the display in the command prompt window. So one could visually see everything AND have a clean log at the same time.

thanks for the help and keep up with the good work.

Alan

asjones987 avatar Sep 07 '21 20:09 asjones987

I've added basic dedicated log support in the newest release. You can find it here: https://github.com/Killeroo/PowerPing/releases/tag/v1.3.4

Killeroo avatar Feb 03 '24 21:02 Killeroo