forked from serilog/serilog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request serilog#934 from serilog/dev
2.4.0 Release
- Loading branch information
Showing
42 changed files
with
2,299 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,14 @@ | ||
language: csharp | ||
|
||
#dotnet cli require Ubuntu 14.04 | ||
sudo: required | ||
dist: trusty | ||
|
||
#dotnet cli require OSX 10.10 | ||
osx_image: xcode7.1 | ||
|
||
addons: | ||
apt: | ||
packages: | ||
- gettext | ||
- libcurl4-openssl-dev | ||
- libicu-dev | ||
- libssl-dev | ||
- libunwind8 | ||
- zlib1g | ||
|
||
os: | ||
- linux | ||
|
||
env: | ||
matrix: | ||
- CLI_VERSION=1.0.0-preview2-003121 | ||
- CLI_VERSION=Latest | ||
|
||
matrix: | ||
allow_failures: | ||
- env: CLI_VERSION=Latest | ||
|
||
before_install: | ||
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; brew link --force openssl; fi | ||
# Download script to install dotnet cli | ||
- if test "$CLI_OBTAIN_URL" == ""; then export CLI_OBTAIN_URL="https://raw.githubusercontent.com/dotnet/cli/rel/1.0.0-preview2/scripts/obtain/dotnet-install.sh"; fi | ||
- curl -L --create-dirs $CLI_OBTAIN_URL -o ./scripts/obtain/install.sh | ||
- find ./scripts -name "*.sh" -exec chmod +x {} \; | ||
- export DOTNET_INSTALL_DIR="$PWD/.dotnetcli" | ||
# use bash to workaround bug https://github.com/dotnet/cli/issues/1725 | ||
- sudo bash ./scripts/obtain/install.sh --channel "preview" --version "$CLI_VERSION" --install-dir "$DOTNET_INSTALL_DIR" --no-path | ||
# add dotnet to PATH | ||
- export PATH="$DOTNET_INSTALL_DIR:$PATH" | ||
include: | ||
- os: linux # Ubuntu 14.04 | ||
dist: trusty | ||
sudo: required | ||
dotnet: 1.0.0-preview2-003121 | ||
- os: osx # OSX 10.11 | ||
osx_image: xcode7.2 | ||
dotnet: 1.0.0-preview2-003121 | ||
|
||
script: | ||
- ./build.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,110 @@ | ||
#Serilog [![Build status](https://ci.appveyor.com/api/projects/status/b9rm3l7kduryjgcj/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog/branch/master) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.svg?style=flat)](https://www.nuget.org/packages/Serilog/) [![Rager Releases](http://rager.io/badge.svg?url=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FSerilog%2F)](http://rager.io/projects/search?badge=1&query=nuget.org/packages/Serilog/) [![Join the chat at https://gitter.im/serilog/serilog](https://img.shields.io/gitter/room/serilog/serilog.svg)](https://gitter.im/serilog/serilog) | ||
#Serilog [![Build status](https://ci.appveyor.com/api/projects/status/b9rm3l7kduryjgcj/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog/branch/master) [![NuGet Version](http://img.shields.io/nuget/v/Serilog.svg?style=flat)](https://www.nuget.org/packages/Serilog/) [![Rager Releases](http://rager.io/badge.svg?url=https%3A%2F%2Fwww.nuget.org%2Fpackages%2FSerilog%2F)](http://rager.io/projects/search?badge=1&query=nuget.org/packages/Serilog/) [![Join the chat at https://gitter.im/serilog/serilog](https://img.shields.io/gitter/room/serilog/serilog.svg)](https://gitter.im/serilog/serilog) [![Stack Overflow](https://img.shields.io/badge/stack%20overflow-serilog-orange.svg)](http://stackoverflow.com/questions/tagged/serilog) | ||
|
||
Serilog combines the best features of traditional and structured diagnostic logging in an easy-to-use package. | ||
Serilog is a diagnostic logging library for .NET applications. It is easy to set up, has a clean API, and runs on all recent .NET platforms. While it's useful even in the simplest applications, Serilog's support for structured logging shines when instrumenting complex, distributed, and asynchronous applications and systems. | ||
|
||
* **[2.0 Upgrade Guide](https://github.com/serilog/serilog/wiki/2.x-Upgrade-Guide)** and [Release Notes](https://github.com/serilog/serilog/blob/dev/CHANGES.md) | ||
* [Homepage](http://serilog.net) | ||
* [Documentation](https://github.com/serilog/serilog/wiki) | ||
[![Serilog](https://serilog.net/images/serilog-180px.png)](https://serilog.net) | ||
|
||
Would you like to help make Serilog even better? We keep a list of issues that are approachable for newcomers under the [up-for-grabs](https://github.com/serilog/serilog/issues?labels=up-for-grabs&state=open) label! | ||
Like many other libraries for .NET, Serilog provides diagnostic logging to [files](https://github.com/serilog/serilog-sinks-rollingfile), the [console](https://github.com/serilog/serilog-sinks-literate), and [many other outputs](https://github.com/serilog/serilog/wiki/Provided-Sinks). | ||
|
||
```csharp | ||
var log = new LoggerConfiguration() | ||
.WriteTo.LiterateConsole() | ||
.WriteTo.RollingFile("log-{Date}.txt") | ||
.CreateLogger(); | ||
|
||
log.Information("Hello, Serilog!"); | ||
``` | ||
|
||
Unlike other logging libraries, Serilog is built from the ground up to record _structured event data_. | ||
|
||
```csharp | ||
var position = new { Latitude = 25, Longitude = 134 }; | ||
var elapsedMs = 34; | ||
|
||
log.Information("Processed {@Position} in {Elapsed} ms.", position, elapsedMs); | ||
``` | ||
|
||
Serilog uses [message templates](https://messagetemplates.org), a simple DSL that extends .NET format strings with _named_ as well as positional parameters. Instead of formatting events immediately into text, Serilog captures the values associated with each named parameter. | ||
|
||
The example above records two properties, `Position` and `Elapsed`, in the log event. The `@` operator in front of `Position` tells Serilog to _serialize_ the object passed in, rather than convert it using `ToString()`. Serilog's deep and rich support for structured event data opens up a huge range of diagnostic possibilities not available when using traditional loggers. | ||
|
||
Rendered into [JSON format](https://github.com/serilog/serilog-formatting-compact) for example, these properties appear alongside the timestamp, level, and message like: | ||
|
||
```json | ||
{"Position": {"Latitude": 25, "Longitude": 134}, "Elapsed": 34} | ||
``` | ||
|
||
Back-ends that are capable of recording structured event data make log searches and analysis possible without log parsing or regular expressions. | ||
|
||
Supporting structured data doesn't mean giving up text: when Serilog writes events to files or the console, the template and properties are rendered into friendly human-readable text just like a traditional logging library would produce: | ||
|
||
``` | ||
09:14:22 [INF] Processed { Latitude: 25, Longitude: 134 } in 34 ms. | ||
``` | ||
|
||
> **Upgrading from Serilog 1.x?** Check out the [2.0 Upgrade Guide](https://github.com/serilog/serilog/wiki/2.x-Upgrade-Guide) and [Release Notes](https://github.com/serilog/serilog/blob/dev/CHANGES.md). | ||
### Features | ||
|
||
* **Community-backed and actively developed** | ||
* Format-based logging API with familiar [levels](https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level) like `Debug`, `Information`, `Warning`, `Error`, and so-on | ||
* Discoverable C# configuration syntax and optional [XML](https://github.com/serilog/serilog-settings-appsettings) or [JSON](https://github.com/serilog/serilog-settings-configuration) configuration support | ||
* Efficient when enabled, extremely low overhead when a logging level is switched off | ||
* Best-in-class .NET Core support, including a [provider for _Microsoft.Extensions.Logging_](https://github.com/serilog/serilog-extensions-logging) | ||
* Support for a [comprehensive range of sinks](https://github.com/serilog/serilog/wiki/Provided-Sinks), including files, the console, on-premises and cloud-based log servers, databases, and message queues | ||
* Sophisticated [enrichment](https://github.com/serilog/serilog/wiki/Enrichment) of log events with contextual information, including scoped (`LogContext`) properties, thread and process identifiers, and domain-specific correlation ids such as `HttpRequestId` | ||
* Zero-shared-state `Logger` objects, with an optional global static `Log` class | ||
* Format-agnostic logging pipeline that can emit events in plain text, JSON, in-memory `LogEvent` objects (including [Rx pipelines](https://github.com/serilog/serilog-sinks-observable)) and other formats | ||
|
||
### Getting started | ||
|
||
Serilog is installed from NuGet. To view log events, one or more sinks need to be installed as well, here we'll use the pretty-printing "literate" console sink, and a rolling file set: | ||
|
||
``` | ||
Install-Package Serilog | ||
Install-Package Serilog.Sinks.Literate | ||
Install-Package Serilog.Sinks.RollingFile | ||
``` | ||
|
||
The simplest way to set up Serilog is using the static `Log` class. A `LoggerConfiguration` is used to create and assign the default logger. | ||
|
||
```csharp | ||
public class Program | ||
{ | ||
public static void Main() | ||
{ | ||
Log.Logger = new LoggerConfiguration() | ||
.MinimumLevel.Information() | ||
.WriteTo.LiterateConsole() | ||
.WriteTo.RollingFile("log-{Date}.txt") | ||
.CreateLogger(); | ||
} | ||
} | ||
``` | ||
|
||
|
||
Find more, including a runnable example application, under the [Getting Started topic](https://github.com/serilog/serilog/wiki/Getting-Started) in the [documentation](https://github.com/serilog/serilog/wiki/). | ||
|
||
### Getting help | ||
|
||
To learn more about Serilog, check out the [documentation](https://github.com/serilog/serilog/wiki) - you'll find information there on the most common scenarios. If Serilog isn't working the way you expect, you may find the [troubleshooting guide](https://github.com/serilog/serilog/wiki/Debugging-and-Diagnostics) useful. | ||
|
||
Serilog has an active and helpful community who are happy to help point you in the right direction or work through any issues you might encounter. You can get in touch via: | ||
|
||
* [Stack Overflow](http://stackoverflow.com/questions/tagged/serilog) - this is the best place to start if you have a question | ||
* Our [issue tracker](https://github.com/serilog/serilog/issues) here on GitHub | ||
* [Gitter chat](https://gitter.im/serilog/serilog) | ||
* The [#serilog tag on Twitter](https://twitter.com/search?q=%23serilog) | ||
|
||
### Contributing | ||
|
||
Would you like to help make Serilog even better? We keep a list of issues that are approachable for newcomers under the [up-for-grabs](https://github.com/serilog/serilog/issues?labels=up-for-grabs&state=open) label. Before starting work on a pull request, we suggest commenting on, or raising, an issue on the issue tracker so that we can help and coordinate efforts. | ||
|
||
### Detailed build status | ||
|
||
Branch | AppVeyor | Travis | ||
------------- | ------------- |------------- | ||
dev | [![Build status](https://ci.appveyor.com/api/projects/status/b9rm3l7kduryjgcj/branch/dev?svg=true)](https://ci.appveyor.com/project/serilog/serilog/branch/dev) | [![Build Status](https://travis-ci.org/serilog/serilog.svg?branch=dev)](https://travis-ci.org/serilog/serilog) | ||
master | [![Build status](https://ci.appveyor.com/api/projects/status/b9rm3l7kduryjgcj/branch/master?svg=true)](https://ci.appveyor.com/project/serilog/serilog/branch/master) | [![Build Status](https://travis-ci.org/serilog/serilog.svg?branch=master)](https://travis-ci.org/serilog/serilog) | ||
|
||
_Copyright © 2013-2016 Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html). Needle and thread logo a derivative of work by [Kenneth Appiah](http://www.kensets.com/)._ | ||
_Serilog is copyright © 2013-2016 Serilog Contributors - Provided under the [Apache License, Version 2.0](http://apache.org/licenses/LICENSE-2.0.html). Needle and thread logo a derivative of work by [Kenneth Appiah](http://www.kensets.com/)._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
....5.2/MessageTemplateCache/MessageTemplateCacheBenchmark_Cached-report-github.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
```ini | ||
|
||
Host Process Environment Information: | ||
BenchmarkDotNet.Core=v0.9.9.0 | ||
OS=Microsoft Windows NT 6.2.9200.0 | ||
Processor=Intel(R) Core(TM) i7-4790 CPU 3.60GHz, ProcessorCount=8 | ||
Frequency=3507509 ticks, Resolution=285.1026 ns, Timer=TSC | ||
CLR=MS.NET 4.0.30319.42000, Arch=64-bit RELEASE [RyuJIT] | ||
GC=Concurrent Workstation | ||
JitModules=clrjit-v4.6.1586.0 | ||
|
||
Type=MessageTemplateCacheBenchmark_Cached Mode=Throughput | ||
|
||
``` | ||
Method | Items | MaxDegreeOfParallelism | Median | StdDev | Scaled | Scaled-SD | | ||
----------- |------ |----------------------- |-------------- |----------- |------- |---------- | | ||
**Dictionary** | **10** | **-1** | **479.2330 us** | **8.4171 us** | **1.00** | **0.00** | | ||
Hashtable | 10 | -1 | 31.3853 us | 0.9122 us | 0.07 | 0.00 | | ||
Concurrent | 10 | -1 | 30.8517 us | 0.5337 us | 0.06 | 0.00 | | ||
**Dictionary** | **10** | **1** | **118.6307 us** | **2.1275 us** | **1.00** | **0.00** | | ||
Hashtable | 10 | 1 | 101.8377 us | 3.3030 us | 0.86 | 0.03 | | ||
Concurrent | 10 | 1 | 99.8312 us | 2.0072 us | 0.85 | 0.02 | | ||
**Dictionary** | **20** | **-1** | **814.2458 us** | **4.7079 us** | **1.00** | **0.00** | | ||
Hashtable | 20 | -1 | 54.0605 us | 0.8628 us | 0.07 | 0.00 | | ||
Concurrent | 20 | -1 | 54.0682 us | 1.1269 us | 0.07 | 0.00 | | ||
**Dictionary** | **20** | **1** | **247.6677 us** | **3.9224 us** | **1.00** | **0.00** | | ||
Hashtable | 20 | 1 | 212.1726 us | 7.2594 us | 0.85 | 0.03 | | ||
Concurrent | 20 | 1 | 201.6514 us | 7.5841 us | 0.81 | 0.03 | | ||
**Dictionary** | **50** | **-1** | **1,522.8901 us** | **7.7962 us** | **1.00** | **0.00** | | ||
Hashtable | 50 | -1 | 123.5203 us | 2.2916 us | 0.08 | 0.00 | | ||
Concurrent | 50 | -1 | 121.7588 us | 2.8585 us | 0.08 | 0.00 | | ||
**Dictionary** | **50** | **1** | **591.6731 us** | **5.2648 us** | **1.00** | **0.00** | | ||
Hashtable | 50 | 1 | 515.3277 us | 10.1826 us | 0.87 | 0.02 | | ||
Concurrent | 50 | 1 | 493.4330 us | 4.9567 us | 0.83 | 0.01 | | ||
**Dictionary** | **100** | **-1** | **2,469.4364 us** | **10.4088 us** | **1.00** | **0.00** | | ||
Hashtable | 100 | -1 | 237.0286 us | 2.6360 us | 0.10 | 0.00 | | ||
Concurrent | 100 | -1 | 238.5870 us | 3.0985 us | 0.10 | 0.00 | | ||
**Dictionary** | **100** | **1** | **1,157.9635 us** | **8.0010 us** | **1.00** | **0.00** | | ||
Hashtable | 100 | 1 | 982.2426 us | 16.9287 us | 0.85 | 0.02 | | ||
Concurrent | 100 | 1 | 964.2989 us | 19.8753 us | 0.84 | 0.02 | | ||
**Dictionary** | **1000** | **-1** | **2,479.2089 us** | **10.0258 us** | **1.00** | **0.00** | | ||
Hashtable | 1000 | -1 | 244.9505 us | 3.0286 us | 0.10 | 0.00 | | ||
Concurrent | 1000 | -1 | 239.5800 us | 3.2452 us | 0.10 | 0.00 | | ||
**Dictionary** | **1000** | **1** | **1,164.8552 us** | **6.4559 us** | **1.00** | **0.00** | | ||
Hashtable | 1000 | 1 | 1,002.4865 us | 10.4370 us | 0.86 | 0.01 | | ||
Concurrent | 1000 | 1 | 973.6633 us | 13.2212 us | 0.84 | 0.01 | |
Oops, something went wrong.