Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log to file #116

Closed
n3t opened this issue Mar 17, 2020 · 10 comments
Closed

Log to file #116

n3t opened this issue Mar 17, 2020 · 10 comments

Comments

@n3t
Copy link

n3t commented Mar 17, 2020

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

@Killeroo
Copy link
Owner

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.

@n3t
Copy link
Author

n3t commented Mar 17, 2020

Thanks :)

@Killeroo
Copy link
Owner

@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.

@MortenMacFly
Copy link

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!

@Killeroo
Copy link
Owner

Killeroo commented Apr 2, 2021

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

@MortenMacFly
Copy link

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

@asjones987
Copy link

asjones987 commented Aug 23, 2021

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.

@Killeroo
Copy link
Owner

@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.

@asjones987
Copy link

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

Killeroo added a commit that referenced this issue Mar 9, 2022
@Killeroo Killeroo moved this from To do to In progress in v2.0.0 Mar 9, 2022
@Killeroo Killeroo moved this from In progress to Done in v2.0.0 Mar 14, 2022
@Killeroo Killeroo added this to todo in v1.4.0 Jun 27, 2023
@Killeroo Killeroo moved this from todo to done in v1.4.0 Jun 27, 2023
@Killeroo Killeroo moved this from Done---- to Done in v1.4.0 Jun 27, 2023
@Killeroo
Copy link
Owner

Killeroo commented Feb 3, 2024

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 Killeroo closed this as completed Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Archived in project
v1.4.0
  
Done
v2.0.0
  
Done
Development

No branches or pull requests

4 participants