Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 13 12:22
    gwinnem commented #511
  • Sep 10 12:48
    nyakimov commented #790
  • Sep 10 04:58
    lahma commented #790
  • Sep 10 04:58
    lahma closed #790
  • Sep 10 04:57
    lahma milestoned #790
  • Sep 08 15:47
    lahma closed #791
  • Sep 08 15:47
    lahma milestoned #791
  • Sep 08 15:35
    lahma synchronize #791
  • Sep 07 17:45
    lahma closed #667
  • Sep 07 17:45
    lahma commented #667
  • Sep 07 16:43
    lahma synchronize #791
  • Sep 07 16:06
    lahma synchronize #791
  • Sep 07 15:45
    lahma synchronize #791
  • Sep 07 15:43
    lahma synchronize #791
  • Sep 07 15:33
    lahma synchronize #791
  • Sep 07 15:32
    lahma opened #791
  • Sep 06 00:33
    rmacfadyen commented #399
  • Sep 06 00:32
    rmacfadyen commented #399
  • Sep 06 00:10
    rmacfadyen commented #399
  • Sep 05 16:57
    nyakimov commented #790
DrCopyPaste
@DrCopyPaste
did you try to adapt the sample code from the link above? did register your provider with LogProvider.SetCurrentLogProvider(new ConsoleLoggingProvider()); ?
Djinnet
@djinnet
Well, the only thing that showed up is the Ilogger and the worker service is the new hosted service from asp.net 3.0. https://devblogs.microsoft.com/aspnet/net-core-workers-as-windows-services/ And yes. I have register the provider.
in theory, it should work since the worker is just like an hosted service with Dependency injection.
DrCopyPaste
@DrCopyPaste
hm, maybe if you have a minimal reproducable sample code to share?
otherwise try starting out with the minimal working quartz.net without any worker service or other customization and try getting logging working from there
then setup special logging
is your logging provider public? I had a problem using it when it was only a private class and tried passing it through topshelf for instance would just not work
Djinnet
@djinnet
I can make the sample code ready in a hour on Github. And yes, the provider is public.
DrCopyPaste
@DrCopyPaste
Sry Im not much of help right now, Id guess its just an accessibility issue, maybe the DI, did not do anything worker service as of yet, but Id have a look if you post it, later
what did you mean with "the only thing that showed up is the Ilogger"? Show up where?
Djinnet
@djinnet
That's okay. It's a big help to have someone with better knowledge about how the system works. Can I tag you when I have the sample on Github? Well, it showed in the console. I think it makes sense when you have seen the code.
DrCopyPaste
@DrCopyPaste
Sure you can, I hope I notice that, don't use github for messaging that much, otherwise, just write about it here with alink
Djinnet
@djinnet
@DrCopyPaste https://github.com/djinnet/QuartzWorkerSample I hope it's not too much code that I have added to the sample.
DrCopyPaste
@DrCopyPaste
aw project file incomplete, imports missing?
ah i think i dont have .net core 3 yet
trying :D
hope this works im still on vs 2017
DrCopyPaste
@DrCopyPaste
ah crap 3.0 sdk is not for 2017, would this work with 2.1 also?
Djinnet
@djinnet
3.0 sdk is for the preview 2019. The worker service only works with 3.0 sdk sadly.
DrCopyPaste
@DrCopyPaste
yea i see i could enable preview in vs 2017
but i cannt select 3.0 despite having installed the sdk
maybe i need a reboot
did this line work though?
Console.WriteLine($"[{ DateTime.Now.ToLongTimeString() }] [{ level }]" + func(), parameters);
Djinnet
@djinnet
Let me test that.
Nope. Didn't show up.
DrCopyPaste
@DrCopyPaste
what if you breakpoint into it
is the breakpoint hit?
on if(level >= Quartz.Logging.LogLevel.Info && func != null)
Djinnet
@djinnet
Hmm... Interesting. The breakpoint didn't get hit.
DrCopyPaste
@DrCopyPaste
might be ordering
try move that line up
LogProvider.SetCurrentLogProvider(new IloggerProvider());
before
StdSchedulerFactory factory = new StdSchedulerFactory(props);
Djinnet
@djinnet
beautiful! It hits and show on the console. :D
DrCopyPaste
@DrCopyPaste
nice!
Djinnet
@djinnet
I didn't realized the ordering is important.
DrCopyPaste
@DrCopyPaste
yea i learned that from trial and error just few days ago :)
Djinnet
@djinnet
which is weird because I have looking at the docs again, and there were no mentioning of the ordering.
DrCopyPaste
@DrCopyPaste
yea its rather implicit that way
but usually
if you start with the simple examples from the page they should work as described if you copy paste 100%
and work from there
that usually helps me isolate things
but im glad it worked and i didnt have to dive too deep into .net core yet :DDD
Djinnet
@djinnet
Yeah. However I learned from the past that copy paste 100% are normally a bad idea. And I am glad too. Thank you so much. :D
DrCopyPaste
@DrCopyPaste
yea not for production code
but to get the workings and fiddling around
alas I have to honor my name
Djinnet
@djinnet
Haha. Once again, thank you so much. Now I can try to see if it work in my real code as well.
DrCopyPaste
@DrCopyPaste
welcome
its nice to fill this room with more interest :)
Marko Lahma
@lahma
👍🏻