I'm trying to get Topshelf to log errors when it's trying to start up my service. I have added the Log4NetIntergration assembly and I'm using this host setup:
How ever I'm not getting any logging from Topshelf. Also if there is an un-handled exception when trying to start the service, Topshelf seems to be swallowing exceptions. I did some digging and it seems to be this part of the Topshelf code that's causing my problem:
From: public static class HostFactory.......
public static void Run(Action<HostConfigurator> configure) { try { New(configure) .Run();
}
catch (Exception ex) { _log.Error("The service exited abnormally with an exception", ex);
} }
For some reason the the logger instance is not writing via log4net. Also should the host process swallow an exception like this? should throw after it's logged the exception?
Here's a quick shot in the dark: try passing empty string "" to UseLog4Net.
The official site REALLY needs to include how to enable logging. It is
extremely frustrating to try out for the first time (in a long time) and
not have it not give any form of feedback.
On 2012-06-15, at 5:59 AM, Keith Stenson <ksten...@gmail.n com> wrote:
Hi Guys,
I'm trying to get Topshelf to log errors when it's trying to start up my
service. I have added the Log4NetIntergration assembly and I'm using this
host setup:
How ever I'm not getting any logging from Topshelf. Also if there is an
un-handled exception when trying to start the service, Topshelf seems to be
swallowing exceptions. I did some digging and it seems to be this part of
the Topshelf code that's causing my problem:
From: public static class HostFactory.......
public static void Run(Action<HostConfigurator> configure)
{
try
{
New(configure)
.Run();
}
catch (Exception ex)
{
_log.Error("The service exited abnormally with an exception", ex);
}
}
For some reason the the logger instance is not writing via log4net. Also
should the host process swallow an exception like this? should throw after
it's logged the exception?
> Here's a quick shot in the dark: try passing empty string "" to UseLog4Net.
> The official site REALLY needs to include how to enable logging. It is
> extremely frustrating to try out for the first time (in a long time) and
> not have it not give any form of feedback.
> On 2012-06-15, at 5:59 AM, Keith Stenson <ksten...@gmail.n com> wrote:
> Hi Guys,
> I'm trying to get Topshelf to log errors when it's trying to start up my
> service. I have added the Log4NetIntergration assembly and I'm using this
> host setup:
> How ever I'm not getting any logging from Topshelf. Also if there is an
> un-handled exception when trying to start the service, Topshelf seems to be
> swallowing exceptions. I did some digging and it seems to be this part of
> the Topshelf code that's causing my problem:
> From: public static class HostFactory.......
> public static void Run(Action<HostConfigurator> configure)
> {
> try
> {
> New(configure)
> .Run();
> }
> catch (Exception ex)
> {
> _log.Error("The service exited abnormally with an exception", ex);
> }
> }
> For some reason the the logger instance is not writing via log4net. Also
> should the host process swallow an exception like this? should throw after
> it's logged the exception?
> Here's a quick shot in the dark: try passing empty string "" to UseLog4Net.
> The official site REALLY needs to include how to enable logging. It is
> extremely frustrating to try out for the first time (in a long time) and
> not have it not give any form of feedback.
> On 2012-06-15, at 5:59 AM, Keith Stenson <ksten...@gmail.n com> wrote:
> Hi Guys,
> I'm trying to get Topshelf to log errors when it's trying to start up my
> service. I have added the Log4NetIntergration assembly and I'm using this
> host setup:
> How ever I'm not getting any logging from Topshelf. Also if there is an
> un-handled exception when trying to start the service, Topshelf seems to be
> swallowing exceptions. I did some digging and it seems to be this part of
> the Topshelf code that's causing my problem:
> From: public static class HostFactory.......
> public static void Run(Action<HostConfigurator> configure)
> {
> try
> {
> New(configure)
> .Run();
> }
> catch (Exception ex)
> {
> _log.Error("The service exited abnormally with an exception", ex);
> }
> }
> For some reason the the logger instance is not writing via log4net. Also
> should the host process swallow an exception like this? should throw after
> it's logged the exception?
> Is it possible to get the default trace logger to output to the console
> when you're just running from the command line?
> Thanks,
> Mario
> On 2012-06-15, at 8:14 AM, Dru Sellers <d...@drusellers.com> wrote:
> My apologies everyone,
> When we switched over to the new logging I failed to update the docs. I
> will do that today.
> -d
> On Fri, Jun 15, 2012 at 6:38 AM, Mario Pareja <pareja.ma...@gmail.com>wrote:
>> Here's a quick shot in the dark: try passing empty string "" to
>> UseLog4Net.
>> The official site REALLY needs to include how to enable logging. It is
>> extremely frustrating to try out for the first time (in a long time) and
>> not have it not give any form of feedback.
>> On 2012-06-15, at 5:59 AM, Keith Stenson <ksten...@gmail.n com> wrote:
>> Hi Guys,
>> I'm trying to get Topshelf to log errors when it's trying to start up my
>> service. I have added the Log4NetIntergration assembly and I'm using this
>> host setup:
>> How ever I'm not getting any logging from Topshelf. Also if there is an
>> un-handled exception when trying to start the service, Topshelf seems to be
>> swallowing exceptions. I did some digging and it seems to be this part of
>> the Topshelf code that's causing my problem:
>> From: public static class HostFactory.......
>> public static void Run(Action<HostConfigurator> configure)
>> {
>> try
>> {
>> New(configure)
>> .Run();
>> }
>> catch (Exception ex)
>> {
>> _log.Error("The service exited abnormally with an exception", ex);
>> }
>> }
>> For some reason the the logger instance is not writing via log4net. Also
>> should the host process swallow an exception like this? should throw after
>> it's logged the exception?
> On Fri, Jun 15, 2012 at 7:25 AM, Mario Pareja <pareja.ma...@gmail.com>wrote:
>> Hey Drew,
>> Is it possible to get the default trace logger to output to the console
>> when you're just running from the command line?
>> Thanks,
>> Mario
>> On 2012-06-15, at 8:14 AM, Dru Sellers <d...@drusellers.com> wrote:
>> My apologies everyone,
>> When we switched over to the new logging I failed to update the docs. I
>> will do that today.
>> -d
>> On Fri, Jun 15, 2012 at 6:38 AM, Mario Pareja <pareja.ma...@gmail.com>wrote:
>>> Here's a quick shot in the dark: try passing empty string "" to
>>> UseLog4Net.
>>> The official site REALLY needs to include how to enable logging. It is
>>> extremely frustrating to try out for the first time (in a long time) and
>>> not have it not give any form of feedback.
>>> On 2012-06-15, at 5:59 AM, Keith Stenson <ksten...@gmail.n com> wrote:
>>> Hi Guys,
>>> I'm trying to get Topshelf to log errors when it's trying to start up my
>>> service. I have added the Log4NetIntergration assembly and I'm using this
>>> host setup:
>>> How ever I'm not getting any logging from Topshelf. Also if there is an
>>> un-handled exception when trying to start the service, Topshelf seems to be
>>> swallowing exceptions. I did some digging and it seems to be this part of
>>> the Topshelf code that's causing my problem:
>>> From: public static class HostFactory.......
>>> public static void Run(Action<HostConfigurator> configure)
>>> {
>>> try
>>> {
>>> New(configure)
>>> .Run();
>>> }
>>> catch (Exception ex)
>>> {
>>> _log.Error("The service exited abnormally with an exception", ex);
>>> }
>>> }
>>> For some reason the the logger instance is not writing via log4net. Also
>>> should the host process swallow an exception like this? should throw after
>>> it's logged the exception?
Much better. I think you'll save people hassles by including a logger
one-liner in the Getting Started code sample. Just add "Logger.UseLogger(new
NLogLogger());" to the top of the HostFactory configuration example since
people will inevitably copy-and-edit that sample code and inevitably end up
frustrated because they don't see any output. (I suggested NLog since so
people don't need to think about XML files when they are just trying to
spike things out.)
Is there a way for others to contribute to the documentation?
> On Fri, Jun 15, 2012 at 7:25 AM, Mario Pareja <pareja.ma...@gmail.com>wrote:
>> Hey Drew,
>> Is it possible to get the default trace logger to output to the console
>> when you're just running from the command line?
>> Thanks,
>> Mario
>> On 2012-06-15, at 8:14 AM, Dru Sellers <d...@drusellers.com> wrote:
>> My apologies everyone,
>> When we switched over to the new logging I failed to update the docs. I
>> will do that today.
>> -d
>> On Fri, Jun 15, 2012 at 6:38 AM, Mario Pareja <pareja.ma...@gmail.com>wrote:
>>> Here's a quick shot in the dark: try passing empty string "" to
>>> UseLog4Net.
>>> The official site REALLY needs to include how to enable logging. It is
>>> extremely frustrating to try out for the first time (in a long time) and
>>> not have it not give any form of feedback.
>>> On 2012-06-15, at 5:59 AM, Keith Stenson <ksten...@gmail.n com> wrote:
>>> Hi Guys,
>>> I'm trying to get Topshelf to log errors when it's trying to start up my
>>> service. I have added the Log4NetIntergration assembly and I'm using this
>>> host setup:
>>> How ever I'm not getting any logging from Topshelf. Also if there is an
>>> un-handled exception when trying to start the service, Topshelf seems to be
>>> swallowing exceptions. I did some digging and it seems to be this part of
>>> the Topshelf code that's causing my problem:
>>> From: public static class HostFactory.......
>>> public static void Run(Action<HostConfigurator> configure)
>>> {
>>> try
>>> {
>>> New(configure)
>>> .Run();
>>> }
>>> catch (Exception ex)
>>> {
>>> _log.Error("The service exited abnormally with an exception", ex);
>>> }
>>> }
>>> For some reason the the logger instance is not writing via log4net. Also
>>> should the host process swallow an exception like this? should throw after
>>> it's logged the exception?
> Much better. I think you'll save people hassles by including a logger
> one-liner in the Getting Started code sample. Just add "Logger.UseLogger(new
> NLogLogger());" to the top of the HostFactory configuration example since
> people will inevitably copy-and-edit that sample code and inevitably end up
> frustrated because they don't see any output. (I suggested NLog since so
> people don't need to think about XML files when they are just trying to
> spike things out.)
> Is there a way for others to contribute to the documentation?
> On Fri, Jun 15, 2012 at 10:26 AM, Dru Sellers <d...@drusellers.com> wrote:
>> On Fri, Jun 15, 2012 at 7:25 AM, Mario Pareja <pareja.ma...@gmail.com>wrote:
>>> Hey Drew,
>>> Is it possible to get the default trace logger to output to the console
>>> when you're just running from the command line?
>>> Thanks,
>>> Mario
>>> On 2012-06-15, at 8:14 AM, Dru Sellers <d...@drusellers.com> wrote:
>>> My apologies everyone,
>>> When we switched over to the new logging I failed to update the docs. I
>>> will do that today.
>>> -d
>>> On Fri, Jun 15, 2012 at 6:38 AM, Mario Pareja <pareja.ma...@gmail.com>wrote:
>>>> Here's a quick shot in the dark: try passing empty string "" to
>>>> UseLog4Net.
>>>> The official site REALLY needs to include how to enable logging. It is
>>>> extremely frustrating to try out for the first time (in a long time) and
>>>> not have it not give any form of feedback.
>>>> On 2012-06-15, at 5:59 AM, Keith Stenson <ksten...@gmail.n com> wrote:
>>>> Hi Guys,
>>>> I'm trying to get Topshelf to log errors when it's trying to start up
>>>> my service. I have added the Log4NetIntergration assembly and I'm using
>>>> this host setup:
>>>> How ever I'm not getting any logging from Topshelf. Also if there is an
>>>> un-handled exception when trying to start the service, Topshelf seems to be
>>>> swallowing exceptions. I did some digging and it seems to be this part of
>>>> the Topshelf code that's causing my problem:
>>>> From: public static class HostFactory.......
>>>> public static void Run(Action<HostConfigurator> configure)
>>>> {
>>>> try
>>>> {
>>>> New(configure)
>>>> .Run();
>>>> }
>>>> catch (Exception ex)
>>>> {
>>>> _log.Error("The service exited abnormally with an exception", ex);
>>>> }
>>>> }
>>>> For some reason the the logger instance is not writing via log4net.
>>>> Also should the host process swallow an exception like this? should throw
>>>> after it's logged the exception?