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

[Feature] Serilog w/ NLog support {WIP} #61

Merged
merged 1 commit into from
Jul 7, 2014

Conversation

ruba1987
Copy link
Contributor

Support for using serilog piping to NLog

Depends on: serilog/serilog#153

@jonnii
Copy link

jonnii commented Jun 21, 2014

woot 👍

.MinimumLevel.Is(LogEventLevel.Debug)
.WriteTo.ColoredConsole()
.WriteTo.NLog()
.CreateLogger();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had a chance to use Serilog yet, however is there a reason we'd want to hardcode Castle Core to using the NLog sink rather than allow the consumer to set their own configuration like the log4net and NLog integration?

@ruba1987
Copy link
Contributor Author

So now that this is refactored it no longer requires serilog/serilog#153.

I added some tests and cleaned up the code a bit here and there.

What do you think?

<packages>
<package id="Castle.Core" version="3.3.0" targetFramework="net45" />
<package id="NLog" version="3.1.0.0" targetFramework="net40" requireReinstallation="True" />
<package id="Serilog" version="1.3.33" targetFramework="net45" />
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe loosen this up to 1.3, or even 1.x?

@jonorossi
Copy link
Member

Thanks @ruba1987, sorry for so many comments, but I've added a few more to the updated diff.

@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 1, 2014

Thanks @jonorossi @jonnii for the feedback. I think I have everything updated now.

@jonorossi
Copy link
Member

@ruba1987 Just a few more comments:

  • You've just now added some more NuGet into the solution file for a ".nuget" directory.
  • That #ifdef on src/Castle.Core.Tests/Properties/Settings.Designer.cs is still removed.
  • Seeing as Serilog only supports .NET 4.5 (that's the only DLL you've added), I think we will need to do something to remove those build targets, and conditionally compile the new code in Castle.Core.Tests.

@@ -9,9 +9,10 @@
//------------------------------------------------------------------------------

namespace CastleTests.Properties {
#if !MONO && !SILVERLIGHT
#if !MONO && !SILVERLIGHT
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's here, just on a diff line 12

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, thanks. Whitespace changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I missed that. I will fix that then too.

@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 2, 2014

@jonorossi Let me see what serilog supports for other versions. If I can't find anything I will figure something out to do that. Do you have any suggestions?

And I will remove the .nuget stuff from the .sln file.... that stuff just keeps turning up everywhere... :-(

@jonorossi
Copy link
Member

If Serilog only supports .NET 4.5, that isn't a big problem. We should be able to remove the compilation targets for the unsupported versions in the csproj, and use the DOTNET45 define to conditionally compile the unit test code out. I'm not sure if we'll have any problems building the NuGet packages, but we can work that out when we get to it after we merge.

http://builds.castleproject.org/viewType.html?buildTypeId=Core_Pack

@jonorossi
Copy link
Member

@ruba1987 Before I forget could you please squish all of your commits into a single commit with a descriptive commit message when you are finished. Thanks.

@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 2, 2014

I will deff rebase and squash it before you merge it. I was just waiting
until you guys are happy with it first.
On Jul 2, 2014 7:41 AM, "Jonathon Rossi" notifications@github.com wrote:

@ruba1987 https://github.com/ruba1987 Before I forget could you please
squish all of your commits into a single commit with a descriptive commit
message when you are finished. Thanks.


Reply to this email directly or view it on GitHub
#61 (comment).

@jonorossi
Copy link
Member

Thanks. I've set up your branch in TeamCity so we can sort out any build issues with the unsupported framework versions. It has a VCS trigger so you don't need any permissions to start a build.

http://builds.castleproject.org/project.html?projectId=core_ruba1987_serilog

It looks like the Serilog integration project file still has the AssemblyInfo.cs file listed but not committed, however it is referencing the CommonAssemblyInfo.cs file from the root.

@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 2, 2014

yea, I noticed that. I'm actually a bit confused about that. It looks like the AssemblyInfo.cs files are generated but I don't know how to set that up. They are also listed in the .gitignore file so I would think they aren't supposed to be committed. How do I set that part up?

For now, I have added it to the repo to get the builds in TC working right and then once I know how to set that part up right I will change it.

@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 2, 2014

@jonorossi Ok, the latest version I pushed seems to build fine in all versions. I added Serilog support for 4.0 and 4.5.

Let me know if this looks good and I will squash it.

Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove the generic Debug and Release targets from the new C# project.

@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 3, 2014

@jonorossi looks like I squared everything away and now it builds just fine via TC for all builds.

@jonorossi
Copy link
Member

@ruba1987 I feel really bad continuing to write comments on things that need to change, sorry. The AssemblyInfo.cs file is still listed as committed. Everything else looks good.

@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 4, 2014

Ah damn, I completely forgot to remove that. Sorry for the headache, I will
take care of it as soon as I can log on
On Jul 3, 2014 9:08 PM, "Jonathon Rossi" notifications@github.com wrote:

@ruba1987 https://github.com/ruba1987 I feel really bad continuing to
write comments on things that need to change, sorry. The AssemblyInfo.cs
file is still listed as committed. Everything else looks good.


Reply to this email directly or view it on GitHub
#61 (comment).

@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 6, 2014

@jonorossi Ok, I fixed that issue with the AssemblyInfo.cs file. I also rebased and squashed. let me know if there is anything else that needs to be done on this.

@jonorossi
Copy link
Member

@ruba1987 Thanks, looks all good to me. Sorry this turned out to be painful.

jonorossi added a commit that referenced this pull request Jul 7, 2014
@jonorossi jonorossi merged commit b677193 into castleproject:master Jul 7, 2014
@ruba1987
Copy link
Contributor Author

ruba1987 commented Jul 7, 2014

lol, no worries.

On Sun, Jul 6, 2014 at 10:03 PM, Jonathon Rossi notifications@github.com
wrote:

Merged #61 #61.


Reply to this email directly or view it on GitHub
#61 (comment).

@ruba1987
Copy link
Contributor Author

ruba1987 commented Sep 9, 2014

@jonorossi any chance you guys can push this to nuget? I would like to use the package

@jonorossi
Copy link
Member

@kkozmic @hammett you guys are the owners of the Castle.Core and both existing logging integration packages. Did you want to push this new one?

@jonorossi
Copy link
Member

@kkozmic do you think we should release Castle Core 3.3.1 with this new package?

@kkozmic
Copy link
Contributor

kkozmic commented Sep 10, 2014

Makes sense

sent from my phone
On 10 Sep 2014 16:44, "Jonathon Rossi" notifications@github.com wrote:

@kkozmic https://github.com/kkozmic do you think we should release
Castle Core 3.3.1 with this new package?


Reply to this email directly or view it on GitHub
#61 (comment).

@jonorossi
Copy link
Member

@ruba1987 I've released 3.3.1 to nuget.org. Let me know how you go.

@ruba1987
Copy link
Contributor Author

@jonorossi perfect! It works great. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants