[GitHub] log4net pull request #32: Implement log4net.Extensions.Logging extension for...

2016-08-20 Thread jasonwilliams200OK
GitHub user jasonwilliams200OK opened a pull request:

https://github.com/apache/log4net/pull/32

Implement log4net.Extensions.Logging extension for aspnet core

### Add extension source project - 1ff39f9
Created extension package at: 
`extensions/log4net.Extensions.Logging/log4net.Extensions.Logging`

Note that for the moment until log4net v3 is released (with .NET Core 
support), we have `"log4net": { "target": "project" },` in project.json. After 
that this will be changed to `"log4net": "3.0.0",` or `"log4net": "3.0.0-*",` 
(if some preview is released before the v3 RTM).

### Add test web app for asp extension - 11a0ec1
Added test project (web app) at: 
`extensions/log4net.Extensions.Logging/log4net.Extensions.Logging.Test`

The test web app was simply created by `dotnet new -t web` with addition of 
`"log4net.Extensions.Logging": { "target": "project" }` in project.json, then 
extension usage in `Startup.cs` and a sample log4net settings file at 
`Settings/logconfig.xml`.

To build and run test web app:

```sh
# this script works in Unix shell or Windows PowerShell
    # for Windows Command Prompt use backslashes in `cd` command

git clone https://github.com/jasonwilliams200OK/log4net --single-branch -b 
feature/asp-logging-extension
cd log4net

# restore package
dotnet restore

# build dependencies, web app and run the web app
cd extensions/log4net.Extensions.Logging/log4net.Extensions.Logging.Test
dotnet run
```

Then open localhost:5000 in the browser and logs should appear in the 
console.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jasonwilliams200OK/log4net 
feature/asp-logging-extension

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/log4net/pull/32.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #32


commit 1ff39f995031ff39bf0f3797a4f3e2040ad2b1bb
Author: Peter Jas <nec...@yahoo.com>
Date:   2016-08-21T00:14:53Z

Add extension source project

commit 11a0ec15a9c578587314d508adc4d062d6a9c001
Author: Peter Jas <nec...@yahoo.com>
Date:   2016-08-21T00:51:56Z

Add test web app for asp extension




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #31: Add packOptions

2016-08-20 Thread jasonwilliams200OK
GitHub user jasonwilliams200OK opened a pull request:

https://github.com/apache/log4net/pull/31

Add packOptions

The package produced by:

```sh
cd log4net/netstandard/log4net

dotnet restore
dotnet pack -c Release
```

at `./bin/Release/log4net.3.0.0.nupkg` will have this metadata and upon 
`dotnet publish`, this will be reflected on the package page: 
https://www.nuget.org/packages/log4net/ (for example, currently there is no 
icon/image, after this change there will be the Apache logo).

---

More info on packOptions and publishOptions can be found in project.json 
schema: 
https://github.com/SchemaStore/schemastore/blob/b24ea2f/src/schemas/json/project.json#L239.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jasonwilliams200OK/log4net trunk

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/log4net/pull/31.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #31


commit 01aa4bb3720554e29844b78c503ed0cf9efa0f7e
Author: Peter Jas <nec...@yahoo.com>
Date:   2016-08-20T14:55:41Z

Add packOptions




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net issue #30: Misc. fixes for netstandard

2016-08-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on the issue:

https://github.com/apache/log4net/pull/30
  
I have rebased it against trunk. To review without whitespace diff, here is 
the proper diff link: https://github.com/apache/log4net/pull/30/files?w=1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net issue #16: (LOG4NET-467) .NET Core support

2016-08-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on the issue:

https://github.com/apache/log4net/pull/16
  
@bodewig, #30 fixed exactly this issue. Can you try with my branch?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net issue #16: (LOG4NET-467) .NET Core support

2016-08-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on the issue:

https://github.com/apache/log4net/pull/16
  
Fixed the build breakage and feedback in #30.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #30: Misc. fixes for netstandard

2016-08-13 Thread jasonwilliams200OK
GitHub user jasonwilliams200OK opened a pull request:

https://github.com/apache/log4net/pull/30

Misc. fixes for netstandard

This PR:
- fix the failing build by providing `[Read/Write]Async` overloads for 
net45 and netstandard TFMs in FileAppender. This was a miss in #16 as 
netstandard doesn't have Begin/End Read/Write methods.

- covers some minor code feedback given at 
https://github.com/apache/log4net/pull/16 and code cleanup.

---

FYI: to build the project with .NET CLI on various platforms (downloadable 
from https://dot.net/core), run the following sequence of commands:

```sh
git clone https://github.com/apache/log4net --recursive
cd log4net/netstandard

dotnet restore

dotnet test log4net.tests# this will build log4net.tests,
 # it's dependency log4net and run tests; all 
in one command!
```

I have tested on macOS and Windows and the test result is consistent:

> Test Count: 145, Passed: 107, Failed: 30, Inconclusive: 0, Skipped: 8

/cc @bodewig

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jasonwilliams200OK/log4net trunk

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/log4net/pull/30.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #30


commit f6e66d0c0ae67e533ed1ed09e2218e1aa26514d0
Author: Peter Jas <nec...@yahoo.com>
Date:   2016-08-13T14:43:25Z

Misc. fixes for netstandard




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #26: Remove an unused variable

2016-08-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK closed the pull request at:

https://github.com/apache/log4net/pull/26


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net issue #26: Remove an unused variable

2016-08-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on the issue:

https://github.com/apache/log4net/pull/26
  
Ops, it was actually the one in the following method: 
https://github.com/apache/log4net/blob/6308def/tests/src/Appender/RollingFileAppenderTest.cs#L1711
 which was unused. But now that has been fixed in the current trunk: 
https://github.com/apache/log4net/blob/cb7802b/tests/src/Appender/RollingFileAppenderTest.cs#L1721.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net issue #16: (LOG4NET-467) .NET Core support

2016-08-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on the issue:

https://github.com/apache/log4net/pull/16
  
Thanks a lot @bodewig! I am definitely willing to participate. I will test 
out the master and try to incorporate the feedback in subsequent PR pronto 
(before you start cutting the release :stuck_out_tongue_winking_eye:). I have 
subscribed to log4net-dev mailing list.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #16: (LOG4NET-467) .NET Core support

2016-08-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on a diff in the pull request:

https://github.com/apache/log4net/pull/16#discussion_r74683879
  
--- Diff: src/Util/PatternStringConverters/NewLinePatternConverter.cs ---
@@ -72,6 +75,16 @@ internal sealed class NewLinePatternConverter : 
LiteralPatternConverter, IOption
/// 
public void ActivateOptions()
{
+#if NETSTANDARD1_3
+   if 
(CultureInfo.InvariantCulture.CompareInfo.Compare(Option, "DOS", 
CompareOptions.IgnoreCase) == 0)
+   {
+   Option = "\r\n";
+   }
+   else if 
(CultureInfo.InvariantCulture.CompareInfo.Compare(Option, "UNIX", 
CompareOptions.IgnoreCase) == 0)
--- End diff --

@chlowell, do you think it's a good idea to instead of dogfooding 
`string.Compare(strA, strB, InvariantCulture) == 0` pattern with `CultureInfo` 
comparer, use common denominator `strA.ToUpperInvariant() == 
strB.ToUpperInvariant()` and remove the preprocessor all over the place as part 
of this PR? IMO, this will clean up quite a bit. If you want, I can send a PR 
to your `log4net-core-pcl` branch, then you would just need to update the JIRA 
patch. :)


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #16: (LOG4NET-467) .NET Core support

2016-08-02 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on a diff in the pull request:

https://github.com/apache/log4net/pull/16#discussion_r73228215
  
--- Diff: netstandard/log4net/project.json ---
@@ -0,0 +1,94 @@
+{
+  "name": "log4net",
+  "version": "3.0.0",
+  "frameworks": {
+"netstandard1.3": {
+  "buildOptions": {
+"compile": {
+  "include": [ "*.cs", "../../src/**/*.cs" ],
+  "exclude": [
+"../../src/Appender/AdoNetAppender.cs",
+"../../src/Appender/AspNetTraceAppender.cs",
+"../../src/Appender/ColoredConsoleAppender.cs",
+"../../src/Appender/EventLogAppender.cs",
+"../../src/Appender/NetSendAppender.cs",
+"../../src/Appender/RemotingAppender.cs",
+"../../src/Appender/SmtpAppender.cs",
+"../../src/LogicalThreadContext.cs",
+"../../src/Config/DOMConfigurator.cs",
+"../../src/Config/DOMConfiguratorAttribute.cs",
+"../../src/Config/Log4NetConfigurationSectionHandler.cs",
+"../../src/Layout/Pattern/AspNetCachePatternConverter.cs",
+"../../src/Layout/Pattern/AspNetContextPatternConverter.cs",
+"../../src/Layout/Pattern/AspNetPatternConverter.cs",
+"../../src/Layout/Pattern/AspNetRequestPatternConverter.cs",
+"../../src/Layout/Pattern/AspNetSessionPatternConverter.cs",
+"../../src/Layout/Pattern/StackTraceDetailPatternConverter.cs",
+"../../src/Layout/Pattern/StackTracePatternConverter.cs",
+"../../src/Plugin/RemoteLoggingServerPlugin.cs",
+
"../../src/Util/PatternStringConverters/EnvironmentFolderPathPatternConverter.cs",
+"../../src/Util/LogicalThreadContextProperties.cs",
+"../../src/Util/LogicalThreadContextStacks.cs",
+"../../src/Util/NativeError.cs",
+"../../src/Util/WindowsSecurityContext.cs"
+  ]
+},
+"define": [ "HAS_READERWRITERLOCKSLIM", "NETSTANDARD1_3" ]
--- End diff --

`NETSTANDARD1_3` definition is redundant here.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #16: (LOG4NET-467) .NET Core support

2016-07-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on a diff in the pull request:

https://github.com/apache/log4net/pull/16#discussion_r70601430
  
--- Diff: src/Util/PatternStringConverters/NewLinePatternConverter.cs ---
@@ -72,6 +75,16 @@ internal sealed class NewLinePatternConverter : 
LiteralPatternConverter, IOption
/// 
public void ActivateOptions()
{
+#if NETSTANDARD1_3
+   if 
(CultureInfo.InvariantCulture.CompareInfo.Compare(Option, "DOS", 
CompareOptions.IgnoreCase) == 0)
+   {
+   Option = "\r\n";
+   }
+   else if 
(CultureInfo.InvariantCulture.CompareInfo.Compare(Option, "UNIX", 
CompareOptions.IgnoreCase) == 0)
--- End diff --

Should we just ToLower(), compare with `==` and get rid of the 
preprocessors for all Compare()-like code?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #16: (LOG4NET-467) .NET Core support

2016-07-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on a diff in the pull request:

https://github.com/apache/log4net/pull/16#discussion_r70601024
  
--- Diff: src/Util/ReadOnlyPropertiesDictionary.cs ---
@@ -215,8 +216,13 @@ public virtual void GetObjectData(SerializationInfo 
info, StreamingContext conte
string entryKey = entry.Key as string;
object entryValue = entry.Value;
 
-   // If value is serializable then we add it to 
the list
-   if (entryKey != null && entryValue != null && 
entryValue.GetType().IsSerializable)
+// If value is serializable then we add it to the list
+#if NETSTANDARD1_3
+   bool isSerializable = 
entryValue.GetType().GetTypeInfo().IsSerializable;
+#else
+bool isSerializable = entryValue.GetType().IsSerializable;
+#endif
+if (entryKey != null && entryValue != null && 
isSerializable)
{
--- End diff --

nit: indentation under `#if` `#else` and that of `if (entryKey` is off


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #16: (LOG4NET-467) .NET Core support

2016-07-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on a diff in the pull request:

https://github.com/apache/log4net/pull/16#discussion_r70600785
  
--- Diff: tests/src/Utils.cs ---
@@ -105,7 +114,28 @@ private static Type[] GetTypesArray(object[] args)
 internal static void RemovePropertyFromAllContexts() {
 GlobalContext.Properties.Remove(PROPERTY_KEY);
 ThreadContext.Properties.Remove(PROPERTY_KEY);
+#if !(NETCF || NETSTANDARD1_3)
 LogicalThreadContext.Properties.Remove(PROPERTY_KEY);
+#endif
 }
-   }
+
+// Wrappers because repository/logger retrieval APIs require an 
Assembly argument on NETSTANDARD1_3
+internal static ILog GetLogger(string name)
+{
+#if NETSTANDARD1_3
+return 
LogManager.GetLogger(typeof(Utils).GetTypeInfo().Assembly, name);
+#else
+   return LogManager.GetLogger(name);
+#endif
+}
+
+internal static ILoggerRepository GetRepository()
+{
+#if NETSTANDARD1_3
+return 
LogManager.GetRepository(typeof(Utils).GetTypeInfo().Assembly);
+#else
+   return LogManager.GetRepository();
+#endif
--- End diff --

nit: indentation of either one of two return statements is off


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request #16: (LOG4NET-467) .NET Core support

2016-07-13 Thread jasonwilliams200OK
Github user jasonwilliams200OK commented on a diff in the pull request:

https://github.com/apache/log4net/pull/16#discussion_r70599902
  
--- Diff: src/Appender/AppenderCollection.cs ---
@@ -26,7 +26,10 @@ namespace log4net.Appender
/// A strongly-typed collection of  objects.
/// 
/// Nicko Cadell
-   public class AppenderCollection : ICollection, IList, IEnumerable, 
ICloneable
+   public class AppenderCollection : ICollection, IList, IEnumerable
+#if !NETSTANDARD1_3
+   , ICloneable
--- End diff --

Note that ICloneable is coming back. 
https://github.com/dotnet/corefx/pull/9970
If the new contract doesn't support NETSTANDARD1_3, and we do want to 
support this TxM, then the best way in the future would be to also add 
`NETSTANDARD1_` in the project.json which exposes IColeable interface 
on public surface area.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] log4net pull request: Remove an unused variable

2016-04-26 Thread jasonwilliams200OK
GitHub user jasonwilliams200OK opened a pull request:

https://github.com/apache/log4net/pull/26

Remove an unused variable

Fixes a warning.

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/jasonwilliams200OK/log4net trunk

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/log4net/pull/26.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #26


commit 6308def8654bcdab35c1962ac3f0f7681cd2d6f0
Author: Peter Jas <nec...@yahoo.com>
Date:   2016-04-26T19:03:16Z

Remove an unused variable




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---