Attach console to running service

119 views
Skip to first unread message

Matthew

unread,
Mar 2, 2015, 1:14:29 PM3/2/15
to topshelf...@googlegroups.com
We are using topshelf for long running processes with a great deal of success and find it extremely useful and reliable.

Our applications process a large number of files and commands from the database and spit out an absolutely tremendous amount of information to the console that is not logged or logged in many different places. Normally it doesn't need to be but sometimes it's helpful to see this output. Because our processes can take many hours, we really can not actually stop a service to run it from console.

So I'm wondering if there is any way to attach to the console of an already running service just to view its console output or possibly the Debug.WriteLines? 

Thanks,
Matthew

Dru Sellers

unread,
Mar 2, 2015, 1:15:48 PM3/2/15
to topshelf...@googlegroups.com
Currently no.

What I think you could do, is if you were consistent in your logging - you could build a forwarder that would listen on a given port (UDP???) and then dump the content out

> listen-to-topshelf machine-name port-number

that might be a technique.

-d

--
You received this message because you are subscribed to the Google Groups "topshelf-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to topshelf-discu...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Matthew

unread,
Mar 2, 2015, 7:09:27 PM3/2/15
to topshelf...@googlegroups.com
Thanks. I know it's not directly related to Topshelf but figured it was a good place to ask. Maybe UDP or named pipe would be good. Though I could swear in some other operating system it's just a matter of opening up a debug console and filtering for the correct application so maybe there's something in Windows or .Net to be found.

Dru Sellers

unread,
Mar 2, 2015, 10:07:35 PM3/2/15
to topshelf...@googlegroups.com
if you are logging to the console out - there may be some way to get at it. If you find something let us know. :)

-d

Otto Dandenell

unread,
Mar 3, 2015, 3:35:07 AM3/3/15
to topshelf...@googlegroups.com
Have a look at the answers in this thread:

http://stackoverflow.com/questions/1290543/how-do-i-attach-a-trace-listener-to-a-running-process

You can configure Log4Net to watch a configuration file, so you may
decide, at runtime, to alter the logging configuration.

After that, it's just a matter of preferences if you want to send the
log messages to a log file or some sort of trace listener / debugging tool.

Regards

/ Otto
> <javascript:>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "topshelf-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to topshelf-discu...@googlegroups.com
> <mailto:topshelf-discu...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages