+
+
+ - http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-bulk.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-allocation.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-count.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-fielddata.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-health.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-indices.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-master.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-nodes.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-pending-tasks.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-plugins.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-recovery.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-shards.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-thread-pool.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-update-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-health.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-pending.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-update-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-reroute.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-state.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-stats.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-count.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-percolate.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-delete.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-delete-by-query.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-explain.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-index_.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-analyze.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-clearcache.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-open-close.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-create-index.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-delete-index.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-delete-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-flush.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-open-close.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-optimize.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-put-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-update-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-templates.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-refresh.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-segments.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-stats.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-status.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-validate.html --
- http://www.elasticsearch.org/guide/ --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-multi-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-more-like-this.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-multi-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-multi-termvectors.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-hot-threads.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-info.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-shutdown.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-stats.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-percolate.html --
- http://www.elasticsearch.org/guide/ --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-shards.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-termvectors.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-update.html --
- When mapping automatically using MapFromAttributes()-
- When Indexing this type do not serialize whatever this value hold-
- When mapping automatically using MapFromAttributes()-
- When Indexing this type do not serialize whatever this value hold-
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-scripting.html --
- /{name}
-
- name is mandatory.
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-indices.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-indices.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-shards.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-shards.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-thread-pool.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-thread-pool.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-recovery.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-recovery.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-plugins.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-plugins.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-pending-tasks.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-pending-tasks.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-nodes.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-nodes.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-master.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-master.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-health.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-health.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-fielddata.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/cat-fielddata.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-count.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-count.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-allocation.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-allocation.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-pending.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-pending.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-stats.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-stats.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- /{index}/{name}
-
- neither parameter is optional
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- {repository}
-
- routing value
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- /{index}/{name}
-
- neither parameter is optional
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-shards.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-shards.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-shards.html --
- /{indices}/{types}
-
- all parameters are optional and will default to the defaults for
- {repository}
-
- routing value
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-recovery.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/indices-recovery.html --
- /{indices}
-
- {indices} is optional
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-templates.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-templates.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-field-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-field-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-field-mapping.html --
- /{indices}/{types/{Fields}
-
- {types} is optional, {indices} is too, {Fields} is mandatory
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-percolate.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-percolate.html --
- /{index}/{type}
-
- {index} is optional and so is {type} and will NOT fallback to the defaults of - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-hot-threads.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-hot-threads.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-shutdown.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-shutdown.html --
- /{nodeid}
-
- node id is optional
-
- /{indices}/{types/{name}
-
- {types} is optional, {indices} is too but needs an explicit AllIndices().
- - http://www.elasticsearch.org/guide/ --
- http://www.elasticsearch.org/guide/ --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-types-exists.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-types-exists.html --
- /{index}/{type}
-
- Where neither parameter is optional
- - Here you can register a function that transforms propertynames (default casing, pre- or suffixing) --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-update-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-update-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-update-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-update-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- {repository}
-
- routing value
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-explain.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-explain.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-explain.html --
- /{index}/{type}/{id}
-
- if one of the parameters is not explicitly specified this will fall back to the defaults for type
- /{index}/{type}/{id}
-
- if one of the parameters is not explicitly specified this will fall back to the defaults for type
- this version won't throw if any of the parts are inferred to be empty- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-bulk.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-health.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-reroute.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-state.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-count.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-percolate.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-delete.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-delete-by-query.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-index_.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-analyze.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-clearcache.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-open-close.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-create-index.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-delete-index.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-delete-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-flush.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-open-close.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-optimize.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-put-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-update-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-templates.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-refresh.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-segments.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-stats.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-status.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-validate.html --
- http://www.elasticsearch.org/guide/ --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-multi-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-more-like-this.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-multi-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-multi-termvectors.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-info.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-stats.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-percolate.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-termvectors.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-update.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-count.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-delete.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-delete-by-query.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-delete-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-put-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-validate.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-more-like-this.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-termvectors.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-multi-termvectors.html --
- /{index}/{type}
-
- Where neither parameter is optional
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- {repository}
-
- routing value
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/modules-snapshots.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-index_.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-percolate.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html --
- /{indices}
-
- {indices} is optional but AllIndices() needs to be explicitly called.
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-open-close.html --
- /{index}
-
- index is not optional
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-state.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-clearcache.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-stats.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-nodes-info.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-health.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-analyze.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-status.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-aliases.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-delete.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-count.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-settings.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-stats.html --
- http://www.elasticsearch.org/guide/ --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-delete-index.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-flush.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-delete-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-get-mapping.html --
- /{indices}/{type}
-
- {indices} is optional and so is {type} and will fallback to default of - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-termvectors.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-template.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-segments.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-refresh.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-optimize.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-open-close.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-request-scroll.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-update-settings.html --
- /{index}
-
- index is optional but AllIndices() needs to be explicitly specified for it to be optional
- - http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-delete-by-query.html --
- See also: https://github.com/elasticsearch/elasticsearch/issues/3636 --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-bulk.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cat.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/cluster-reroute.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-create-index.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-put-mapping.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-templates.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/indices-warmers.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-validate.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-benchmark.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-multi-get.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-more-like-this.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-multi-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-percolate.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/search-search.html --
- http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.x/docs-update.html --
Available from Elasticsearch 1.3.0-
Available from Elasticsearch 1.3.0-
- [CanBeNull] public object Test() { return null; }
- public void UseTest() {
- var p = Test();
- var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
- }
-
- [NotNull] public object Foo() {
- return null; // Warning: Possible 'null' assignment
- }
-
- [StringFormatMethod("message")]
- public void ShowError(string message, params object[] args) { /* do something */ }
- public void Foo() {
- ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
- }
-
- public void Foo(string param) {
- if (param == null)
- throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
- }
-
- internal class Foo : INotifyPropertyChanged {
- public event PropertyChangedEventHandler PropertyChanged;
- [NotifyPropertyChangedInvocator]
- protected virtual void NotifyChanged(string propertyName) { ... }
-
- private string _name;
- public string Name {
- get { return _name; }
- set { _name = value; NotifyChanged("LastName"); /* Warning */ }
- }
- }
-
- Examples of generated notifications:
- Function Definition Table syntax:
-
- [ContractAnnotation("=> halt")]
- public void TerminationMethod()
-
- [ContractAnnotation("halt <= condition: false")]
- public void Assert(bool condition, string text) // regular assertion method
-
- [ContractAnnotation("s:null => true")]
- public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
-
- // A method that returns null if the parameter is null, and not null if the parameter is not null
- [ContractAnnotation("null => null; notnull => notnull")]
- public object Transform(object data)
-
- [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
- public bool TryParse(string s, out Person result)
-
- [LocalizationRequiredAttribute(true)]
- internal class Foo {
- private string str = "my string"; // Warning: Localizable string
- }
-
- [CannotApplyEqualityOperator]
- class NoEquality { }
- class UsesNoEquality {
- public void Test() {
- var ca1 = new NoEquality();
- var ca2 = new NoEquality();
- if (ca1 != null) { // OK
- bool condition = ca1 == ca2; // Warning
- }
- }
- }
-
- [BaseTypeRequired(typeof(IComponent)] // Specify requirement
- internal class ComponentAttribute : Attribute { }
- [Component] // ComponentAttribute requires implementing IComponent interface
- internal class MyComponent : IComponent { }
-
- [Pure] private int Multiply(int x, int y) { return x * y; }
- public void Foo() {
- const int a = 2, b = 2;
- Multiply(a, b); // Waring: Return value of pure method is not used
- }
-
- [ActionName("Foo")]
- public ActionResult Login(string returnUrl) {
- ViewBag.ReturnUrl = Url.Action("Foo"); // OK
- return RedirectToAction("Bar"); // Error: Cannot resolve action
- }
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To print the results, use any application that's able to receive messages over - TCP or UDP. NetCat is - a simple but very powerful command-line tool that can be used for that. This image - demonstrates the NetCat tool receiving log messages from Network target. -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will be very slow. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- There are two specialized versions of the Network target: Chainsaw - and NLogViewer which write to instances of Chainsaw log4j viewer - or NLogViewer application respectively. -
-${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- | Condition | -Foreground Color | -Background Color | -
|---|---|---|
| level == LogLevel.Fatal | -Red | -NoChange | -
| level == LogLevel.Error | -Yellow | -NoChange | -
| level == LogLevel.Warn | -Magenta | -NoChange | -
| level == LogLevel.Info | -White | -NoChange | -
| level == LogLevel.Debug | -Gray | -NoChange | -
| level == LogLevel.Trace | -DarkGray | -NoChange | -
- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
-
-
-
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${basedir}/${level}.log
- All
- Caution: Enabling this option can considerably slow down your file
- logging in multi-process scenarios. If only one process is going to
- be writing to the file, consider setting
- To set up the target in the configuration file, - use the following syntax: -
-
- - The result is: -
-
- - To set up the log target programmatically similar to above use code like this: -
-,
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - Mail target works best when used with BufferingWrapper target - which lets you send multiple log messages in single mail -
-- To set up the buffered mail target in the configuration file, - use the following syntax: -
-
- - To set up the buffered mail target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- The result is a message box: -
-
- - To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The result is: -

- To set up the target with coloring rules in the configuration file, - use the following syntax: -
-
-
-
- - The result is: -


- To set up the log target programmatically similar to above use code like this: -
-
- ,
-
-
- for RowColoring,
-
-
- for WordColoring
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- The example web service that works with this example is shown below
-
- - Asynchronous target wrapper allows the logger code to execute more quickly, by queueing - messages and processing them in a separate thread. You should wrap targets - that spend a non-trivial amount of time in their Write() method with asynchronous - target to speed up logging. -
-- Because asynchronous logging is quite a common scenario, NLog supports a - shorthand notation for wrapping all targets with AsyncWrapper. Just add async="true" to - the <targets/> element in the configuration file. -
-
-
- ... your targets go here ...
-
- ]]>
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- This example causes the messages to be written to server1, - and if it fails, messages go to server2.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages not contains the string '1' to be ignored.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - This example works like this. If there are no Warn,Error or Fatal messages in the buffer - only Info messages are written to the file, but if there are any warnings or errors, - the output includes detailed trace (levels >= Debug). You can plug in a different type - of buffering wrapper (such as ASPNetBufferingWrapper) to achieve different - functionality. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt - chosen randomly on a per-message basis. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each log message to be repeated 3 times.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each write attempt to be repeated 3 times, - sleeping 1 second between attempts if first one fails.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt. - Each odd message is written to file2.txt, each even message goes to file1.txt. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to both file1.txt or file2.txt -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
-
- [CanBeNull] public object Test() { return null; }
- public void UseTest() {
- var p = Test();
- var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
- }
-
- [NotNull] public object Foo() {
- return null; // Warning: Possible 'null' assignment
- }
-
- [StringFormatMethod("message")]
- public void ShowError(string message, params object[] args) { /* do something */ }
- public void Foo() {
- ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
- }
-
- public void Foo(string param) {
- if (param == null)
- throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
- }
-
- internal class Foo : INotifyPropertyChanged {
- public event PropertyChangedEventHandler PropertyChanged;
- [NotifyPropertyChangedInvocator]
- protected virtual void NotifyChanged(string propertyName) { ... }
-
- private string _name;
- public string Name {
- get { return _name; }
- set { _name = value; NotifyChanged("LastName"); /* Warning */ }
- }
- }
-
- Examples of generated notifications:
- Function Definition Table syntax:
-
- [ContractAnnotation("=> halt")]
- public void TerminationMethod()
-
- [ContractAnnotation("halt <= condition: false")]
- public void Assert(bool condition, string text) // regular assertion method
-
- [ContractAnnotation("s:null => true")]
- public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
-
- // A method that returns null if the parameter is null, and not null if the parameter is not null
- [ContractAnnotation("null => null; notnull => notnull")]
- public object Transform(object data)
-
- [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
- public bool TryParse(string s, out Person result)
-
- [LocalizationRequiredAttribute(true)]
- internal class Foo {
- private string str = "my string"; // Warning: Localizable string
- }
-
- [CannotApplyEqualityOperator]
- class NoEquality { }
- class UsesNoEquality {
- public void Test() {
- var ca1 = new NoEquality();
- var ca2 = new NoEquality();
- if (ca1 != null) { // OK
- bool condition = ca1 == ca2; // Warning
- }
- }
- }
-
- [BaseTypeRequired(typeof(IComponent)] // Specify requirement
- internal class ComponentAttribute : Attribute { }
- [Component] // ComponentAttribute requires implementing IComponent interface
- internal class MyComponent : IComponent { }
-
- [Pure] private int Multiply(int x, int y) { return x * y; }
- public void Foo() {
- const int a = 2, b = 2;
- Multiply(a, b); // Waring: Return value of pure method is not used
- }
-
- [ActionName("Foo")]
- public ActionResult Login(string returnUrl) {
- ViewBag.ReturnUrl = Url.Action("Foo"); // OK
- return RedirectToAction("Bar"); // Error: Cannot resolve action
- }
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To print the results, use any application that's able to receive messages over - TCP or UDP. NetCat is - a simple but very powerful command-line tool that can be used for that. This image - demonstrates the NetCat tool receiving log messages from Network target. -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will be very slow. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- There are two specialized versions of the Network target: Chainsaw - and NLogViewer which write to instances of Chainsaw log4j viewer - or NLogViewer application respectively. -
-${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- | Condition | -Foreground Color | -Background Color | -
|---|---|---|
| level == LogLevel.Fatal | -Red | -NoChange | -
| level == LogLevel.Error | -Yellow | -NoChange | -
| level == LogLevel.Warn | -Magenta | -NoChange | -
| level == LogLevel.Info | -White | -NoChange | -
| level == LogLevel.Debug | -Gray | -NoChange | -
| level == LogLevel.Trace | -DarkGray | -NoChange | -
- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
-
-
-
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${basedir}/${level}.log
- All
- Caution: Enabling this option can considerably slow down your file
- logging in multi-process scenarios. If only one process is going to
- be writing to the file, consider setting
- To set up the target in the configuration file, - use the following syntax: -
-
- - The result is: -
-
- - To set up the log target programmatically similar to above use code like this: -
-,
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - Mail target works best when used with BufferingWrapper target - which lets you send multiple log messages in single mail -
-- To set up the buffered mail target in the configuration file, - use the following syntax: -
-
- - To set up the buffered mail target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- The result is a message box: -
-
- - To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The result is: -

- To set up the target with coloring rules in the configuration file, - use the following syntax: -
-
-
-
- - The result is: -


- To set up the log target programmatically similar to above use code like this: -
-
- ,
-
-
- for RowColoring,
-
-
- for WordColoring
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- The example web service that works with this example is shown below
-
- - Asynchronous target wrapper allows the logger code to execute more quickly, by queueing - messages and processing them in a separate thread. You should wrap targets - that spend a non-trivial amount of time in their Write() method with asynchronous - target to speed up logging. -
-- Because asynchronous logging is quite a common scenario, NLog supports a - shorthand notation for wrapping all targets with AsyncWrapper. Just add async="true" to - the <targets/> element in the configuration file. -
-
-
- ... your targets go here ...
-
- ]]>
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- This example causes the messages to be written to server1, - and if it fails, messages go to server2.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages not contains the string '1' to be ignored.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - This example works like this. If there are no Warn,Error or Fatal messages in the buffer - only Info messages are written to the file, but if there are any warnings or errors, - the output includes detailed trace (levels >= Debug). You can plug in a different type - of buffering wrapper (such as ASPNetBufferingWrapper) to achieve different - functionality. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt - chosen randomly on a per-message basis. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each log message to be repeated 3 times.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each write attempt to be repeated 3 times, - sleeping 1 second between attempts if first one fails.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt. - Each odd message is written to file2.txt, each even message goes to file1.txt. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to both file1.txt or file2.txt -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
-
- [CanBeNull] public object Test() { return null; }
- public void UseTest() {
- var p = Test();
- var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
- }
-
- [NotNull] public object Foo() {
- return null; // Warning: Possible 'null' assignment
- }
-
- [StringFormatMethod("message")]
- public void ShowError(string message, params object[] args) { /* do something */ }
- public void Foo() {
- ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
- }
-
- public void Foo(string param) {
- if (param == null)
- throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
- }
-
- internal class Foo : INotifyPropertyChanged {
- public event PropertyChangedEventHandler PropertyChanged;
- [NotifyPropertyChangedInvocator]
- protected virtual void NotifyChanged(string propertyName) { ... }
-
- private string _name;
- public string Name {
- get { return _name; }
- set { _name = value; NotifyChanged("LastName"); /* Warning */ }
- }
- }
-
- Examples of generated notifications:
- Function Definition Table syntax:
-
- [ContractAnnotation("=> halt")]
- public void TerminationMethod()
-
- [ContractAnnotation("halt <= condition: false")]
- public void Assert(bool condition, string text) // regular assertion method
-
- [ContractAnnotation("s:null => true")]
- public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
-
- // A method that returns null if the parameter is null, and not null if the parameter is not null
- [ContractAnnotation("null => null; notnull => notnull")]
- public object Transform(object data)
-
- [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
- public bool TryParse(string s, out Person result)
-
- [LocalizationRequiredAttribute(true)]
- internal class Foo {
- private string str = "my string"; // Warning: Localizable string
- }
-
- [CannotApplyEqualityOperator]
- class NoEquality { }
- class UsesNoEquality {
- public void Test() {
- var ca1 = new NoEquality();
- var ca2 = new NoEquality();
- if (ca1 != null) { // OK
- bool condition = ca1 == ca2; // Warning
- }
- }
- }
-
- [BaseTypeRequired(typeof(IComponent)] // Specify requirement
- internal class ComponentAttribute : Attribute { }
- [Component] // ComponentAttribute requires implementing IComponent interface
- internal class MyComponent : IComponent { }
-
- [Pure] private int Multiply(int x, int y) { return x * y; }
- public void Foo() {
- const int a = 2, b = 2;
- Multiply(a, b); // Waring: Return value of pure method is not used
- }
-
- [ActionName("Foo")]
- public ActionResult Login(string returnUrl) {
- ViewBag.ReturnUrl = Url.Action("Foo"); // OK
- return RedirectToAction("Bar"); // Error: Cannot resolve action
- }
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To print the results, use any application that's able to receive messages over - TCP or UDP. NetCat is - a simple but very powerful command-line tool that can be used for that. This image - demonstrates the NetCat tool receiving log messages from Network target. -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will be very slow. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- There are two specialized versions of the Network target: Chainsaw - and NLogViewer which write to instances of Chainsaw log4j viewer - or NLogViewer application respectively. -
-${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- | Condition | -Foreground Color | -Background Color | -
|---|---|---|
| level == LogLevel.Fatal | -Red | -NoChange | -
| level == LogLevel.Error | -Yellow | -NoChange | -
| level == LogLevel.Warn | -Magenta | -NoChange | -
| level == LogLevel.Info | -White | -NoChange | -
| level == LogLevel.Debug | -Gray | -NoChange | -
| level == LogLevel.Trace | -DarkGray | -NoChange | -
- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
-
-
-
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${basedir}/${level}.log
- All
- Caution: Enabling this option can considerably slow down your file
- logging in multi-process scenarios. If only one process is going to
- be writing to the file, consider setting
- To set up the target in the configuration file, - use the following syntax: -
-
- - The result is: -
-
- - To set up the log target programmatically similar to above use code like this: -
-,
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - Mail target works best when used with BufferingWrapper target - which lets you send multiple log messages in single mail -
-- To set up the buffered mail target in the configuration file, - use the following syntax: -
-
- - To set up the buffered mail target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- The result is a message box: -
-
- - To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The result is: -

- To set up the target with coloring rules in the configuration file, - use the following syntax: -
-
-
-
- - The result is: -


- To set up the log target programmatically similar to above use code like this: -
-
- ,
-
-
- for RowColoring,
-
-
- for WordColoring
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- The example web service that works with this example is shown below
-
- - Asynchronous target wrapper allows the logger code to execute more quickly, by queueing - messages and processing them in a separate thread. You should wrap targets - that spend a non-trivial amount of time in their Write() method with asynchronous - target to speed up logging. -
-- Because asynchronous logging is quite a common scenario, NLog supports a - shorthand notation for wrapping all targets with AsyncWrapper. Just add async="true" to - the <targets/> element in the configuration file. -
-
-
- ... your targets go here ...
-
- ]]>
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- This example causes the messages to be written to server1, - and if it fails, messages go to server2.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages not contains the string '1' to be ignored.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - This example works like this. If there are no Warn,Error or Fatal messages in the buffer - only Info messages are written to the file, but if there are any warnings or errors, - the output includes detailed trace (levels >= Debug). You can plug in a different type - of buffering wrapper (such as ASPNetBufferingWrapper) to achieve different - functionality. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt - chosen randomly on a per-message basis. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each log message to be repeated 3 times.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each write attempt to be repeated 3 times, - sleeping 1 second between attempts if first one fails.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt. - Each odd message is written to file2.txt, each even message goes to file1.txt. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to both file1.txt or file2.txt -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
-
- [CanBeNull] public object Test() { return null; }
- public void UseTest() {
- var p = Test();
- var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
- }
-
- [NotNull] public object Foo() {
- return null; // Warning: Possible 'null' assignment
- }
-
- [StringFormatMethod("message")]
- public void ShowError(string message, params object[] args) { /* do something */ }
- public void Foo() {
- ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
- }
-
- public void Foo(string param) {
- if (param == null)
- throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
- }
-
- internal class Foo : INotifyPropertyChanged {
- public event PropertyChangedEventHandler PropertyChanged;
- [NotifyPropertyChangedInvocator]
- protected virtual void NotifyChanged(string propertyName) { ... }
-
- private string _name;
- public string Name {
- get { return _name; }
- set { _name = value; NotifyChanged("LastName"); /* Warning */ }
- }
- }
-
- Examples of generated notifications:
- Function Definition Table syntax:
-
- [ContractAnnotation("=> halt")]
- public void TerminationMethod()
-
- [ContractAnnotation("halt <= condition: false")]
- public void Assert(bool condition, string text) // regular assertion method
-
- [ContractAnnotation("s:null => true")]
- public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
-
- // A method that returns null if the parameter is null, and not null if the parameter is not null
- [ContractAnnotation("null => null; notnull => notnull")]
- public object Transform(object data)
-
- [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
- public bool TryParse(string s, out Person result)
-
- [LocalizationRequiredAttribute(true)]
- internal class Foo {
- private string str = "my string"; // Warning: Localizable string
- }
-
- [CannotApplyEqualityOperator]
- class NoEquality { }
- class UsesNoEquality {
- public void Test() {
- var ca1 = new NoEquality();
- var ca2 = new NoEquality();
- if (ca1 != null) { // OK
- bool condition = ca1 == ca2; // Warning
- }
- }
- }
-
- [BaseTypeRequired(typeof(IComponent)] // Specify requirement
- internal class ComponentAttribute : Attribute { }
- [Component] // ComponentAttribute requires implementing IComponent interface
- internal class MyComponent : IComponent { }
-
- [Pure] private int Multiply(int x, int y) { return x * y; }
- public void Foo() {
- const int a = 2, b = 2;
- Multiply(a, b); // Waring: Return value of pure method is not used
- }
-
- [ActionName("Foo")]
- public ActionResult Login(string returnUrl) {
- ViewBag.ReturnUrl = Url.Action("Foo"); // OK
- return RedirectToAction("Bar"); // Error: Cannot resolve action
- }
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To print the results, use any application that's able to receive messages over - TCP or UDP. NetCat is - a simple but very powerful command-line tool that can be used for that. This image - demonstrates the NetCat tool receiving log messages from Network target. -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will be very slow. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- There are two specialized versions of the Network target: Chainsaw - and NLogViewer which write to instances of Chainsaw log4j viewer - or NLogViewer application respectively. -
-${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${basedir}/${level}.log
- All
- Caution: Enabling this option can considerably slow down your file
- logging in multi-process scenarios. If only one process is going to
- be writing to the file, consider setting
- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- The result is a message box: -
-
- - To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- The example web service that works with this example is shown below
-
- - Asynchronous target wrapper allows the logger code to execute more quickly, by queueing - messages and processing them in a separate thread. You should wrap targets - that spend a non-trivial amount of time in their Write() method with asynchronous - target to speed up logging. -
-- Because asynchronous logging is quite a common scenario, NLog supports a - shorthand notation for wrapping all targets with AsyncWrapper. Just add async="true" to - the <targets/> element in the configuration file. -
-
-
- ... your targets go here ...
-
- ]]>
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- This example causes the messages to be written to server1, - and if it fails, messages go to server2.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages not contains the string '1' to be ignored.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - This example works like this. If there are no Warn,Error or Fatal messages in the buffer - only Info messages are written to the file, but if there are any warnings or errors, - the output includes detailed trace (levels >= Debug). You can plug in a different type - of buffering wrapper (such as ASPNetBufferingWrapper) to achieve different - functionality. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt - chosen randomly on a per-message basis. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each log message to be repeated 3 times.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each write attempt to be repeated 3 times, - sleeping 1 second between attempts if first one fails.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt. - Each odd message is written to file2.txt, each even message goes to file1.txt. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to both file1.txt or file2.txt -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
-
- [CanBeNull] public object Test() { return null; }
- public void UseTest() {
- var p = Test();
- var s = p.ToString(); // Warning: Possible 'System.NullReferenceException'
- }
-
- [NotNull] public object Foo() {
- return null; // Warning: Possible 'null' assignment
- }
-
- [StringFormatMethod("message")]
- public void ShowError(string message, params object[] args) { /* do something */ }
- public void Foo() {
- ShowError("Failed: {0}"); // Warning: Non-existing argument in format string
- }
-
- public void Foo(string param) {
- if (param == null)
- throw new ArgumentNullException("par"); // Warning: Cannot resolve symbol
- }
-
- internal class Foo : INotifyPropertyChanged {
- public event PropertyChangedEventHandler PropertyChanged;
- [NotifyPropertyChangedInvocator]
- protected virtual void NotifyChanged(string propertyName) { ... }
-
- private string _name;
- public string Name {
- get { return _name; }
- set { _name = value; NotifyChanged("LastName"); /* Warning */ }
- }
- }
-
- Examples of generated notifications:
- Function Definition Table syntax:
-
- [ContractAnnotation("=> halt")]
- public void TerminationMethod()
-
- [ContractAnnotation("halt <= condition: false")]
- public void Assert(bool condition, string text) // regular assertion method
-
- [ContractAnnotation("s:null => true")]
- public bool IsNullOrEmpty(string s) // string.IsNullOrEmpty()
-
- // A method that returns null if the parameter is null, and not null if the parameter is not null
- [ContractAnnotation("null => null; notnull => notnull")]
- public object Transform(object data)
-
- [ContractAnnotation("s:null=>false; =>true,result:notnull; =>false, result:null")]
- public bool TryParse(string s, out Person result)
-
- [LocalizationRequiredAttribute(true)]
- internal class Foo {
- private string str = "my string"; // Warning: Localizable string
- }
-
- [CannotApplyEqualityOperator]
- class NoEquality { }
- class UsesNoEquality {
- public void Test() {
- var ca1 = new NoEquality();
- var ca2 = new NoEquality();
- if (ca1 != null) { // OK
- bool condition = ca1 == ca2; // Warning
- }
- }
- }
-
- [BaseTypeRequired(typeof(IComponent)] // Specify requirement
- internal class ComponentAttribute : Attribute { }
- [Component] // ComponentAttribute requires implementing IComponent interface
- internal class MyComponent : IComponent { }
-
- [Pure] private int Multiply(int x, int y) { return x * y; }
- public void Foo() {
- const int a = 2, b = 2;
- Multiply(a, b); // Waring: Return value of pure method is not used
- }
-
- [ActionName("Foo")]
- public ActionResult Login(string returnUrl) {
- ViewBag.ReturnUrl = Url.Action("Foo"); // OK
- return RedirectToAction("Bar"); // Error: Cannot resolve action
- }
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will crawl. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To print the results, use any application that's able to receive messages over - TCP or UDP. NetCat is - a simple but very powerful command-line tool that can be used for that. This image - demonstrates the NetCat tool receiving log messages from Network target. -
-
- - NOTE: If your receiver application is ever likely to be off-line, don't use TCP protocol - or you'll get TCP timeouts and your application will be very slow. - Either switch to UDP transport or use AsyncWrapper target - so that your application threads will not be blocked by the timing-out connection attempts. -
-- There are two specialized versions of the Network target: Chainsaw - and NLogViewer which write to instances of Chainsaw log4j viewer - or NLogViewer application respectively. -
-${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- ${basedir}/${level}.log
- All
- Caution: Enabling this option can considerably slow down your file
- logging in multi-process scenarios. If only one process is going to
- be writing to the file, consider setting
- To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- The result is a message box: -
-
- - To set up the log target programmatically use code like this: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - This assumes just one target and a single rule. More configuration - options are described here. -
-- To set up the log target programmatically use code like this: -
-
- The example web service that works with this example is shown below
-
- - Asynchronous target wrapper allows the logger code to execute more quickly, by queueing - messages and processing them in a separate thread. You should wrap targets - that spend a non-trivial amount of time in their Write() method with asynchronous - target to speed up logging. -
-- Because asynchronous logging is quite a common scenario, NLog supports a - shorthand notation for wrapping all targets with AsyncWrapper. Just add async="true" to - the <targets/> element in the configuration file. -
-
-
- ... your targets go here ...
-
- ]]>
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- ${longdate}|${level:uppercase=true}|${logger}|${message}
- This example causes the messages to be written to server1, - and if it fails, messages go to server2.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages not contains the string '1' to be ignored.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- - This example works like this. If there are no Warn,Error or Fatal messages in the buffer - only Info messages are written to the file, but if there are any warnings or errors, - the output includes detailed trace (levels >= Debug). You can plug in a different type - of buffering wrapper (such as ASPNetBufferingWrapper) to achieve different - functionality. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt - chosen randomly on a per-message basis. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each log message to be repeated 3 times.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes each write attempt to be repeated 3 times, - sleeping 1 second between attempts if first one fails.
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to either file1.txt or file2.txt. - Each odd message is written to file2.txt, each even message goes to file1.txt. -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- This example causes the messages to be written to both file1.txt or file2.txt -
-- To set up the target in the configuration file, - use the following syntax: -
-
- - The above examples assume just one target and a single rule. See below for - a programmatic configuration that's equivalent to the above config file: -
-
- null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null then an null
- If the object is not null then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an NaN value.
- If the object is not NaN then an /*...*/ containing the specified text.
- /*...*/ containing the specified text.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
- /*...*/ containing the specified text.
- /*...*/ containing the specified text.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
- /*...*/ containing the specified text.
- /*...*/ containing the specified text.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
- /*...*/ containing the specified text.
- /*...*/ containing the specified text.
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
-
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- /*...*/ containing the specified text.
- /*...*/ containing the specified text.
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
-
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- /*...*/ containing the specified text.
- /*...*/ containing the specified text.
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
-
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- /*...*/ containing the specified text.
- /*...*/ containing the specified text.
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
- /*...*/ containing the specified text.
-
-
-
-
-
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
- Info will exclude Verbose messages and include Info,
- Warning and Error messages.
-
- using (System.IO.Stream input = System.IO.File.OpenRead(fileToCompress))
- {
- using (var raw = System.IO.File.Create(outputFile))
- {
- using (Stream compressor = new GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, true))
- {
- byte[] buffer = new byte[WORKING_BUFFER_SIZE];
- int n;
- while ((n= input.Read(buffer, 0, buffer.Length)) != 0)
- {
- compressor.Write(buffer, 0, n);
- }
- }
- }
- }
-
-
- Dim outputFile As String = (fileToCompress & ".compressed")
- Using input As Stream = File.OpenRead(fileToCompress)
- Using raw As FileStream = File.Create(outputFile)
- Using compressor As Stream = New GZipStream(raw, CompressionMode.Compress, CompressionLevel.BestCompression, True)
- Dim buffer As Byte() = New Byte(4096) {}
- Dim n As Integer = -1
- Do While (n <> 0)
- If (n > 0) Then
- compressor.Write(buffer, 0, n)
- End If
- n = input.Read(buffer, 0, buffer.Length)
- Loop
- End Using
- End Using
- End Using
-
-
- byte[] working = new byte[WORKING_BUFFER_SIZE];
- using (System.IO.Stream input = System.IO.File.OpenRead(_CompressedFile))
- {
- using (Stream decompressor= new Ionic.Zlib.GZipStream(input, CompressionMode.Decompress, true))
- {
- using (var output = System.IO.File.Create(_DecompressedFile))
- {
- int n;
- while ((n= decompressor.Read(working, 0, working.Length)) !=0)
- {
- output.Write(working, 0, n);
- }
- }
- }
- }
-
-
- private void InflateBuffer()
- {
- int bufferSize = 1024;
- byte[] buffer = new byte[bufferSize];
- ZlibCodec decompressor = new ZlibCodec();
-
- Console.WriteLine("\n============================================");
- Console.WriteLine("Size of Buffer to Inflate: {0} bytes.", CompressedBytes.Length);
- MemoryStream ms = new MemoryStream(DecompressedBytes);
-
- int rc = decompressor.InitializeInflate();
-
- decompressor.InputBuffer = CompressedBytes;
- decompressor.NextIn = 0;
- decompressor.AvailableBytesIn = CompressedBytes.Length;
-
- decompressor.OutputBuffer = buffer;
-
- // pass 1: inflate
- do
- {
- decompressor.NextOut = 0;
- decompressor.AvailableBytesOut = buffer.Length;
- rc = decompressor.Inflate(ZlibConstants.Z_NO_FLUSH);
-
- if (rc != ZlibConstants.Z_OK && rc != ZlibConstants.Z_STREAM_END)
- throw new Exception("inflating: " + decompressor.Message);
-
- ms.Write(decompressor.OutputBuffer, 0, buffer.Length - decompressor.AvailableBytesOut);
- }
- while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0);
-
- // pass 2: finish and flush
- do
- {
- decompressor.NextOut = 0;
- decompressor.AvailableBytesOut = buffer.Length;
- rc = decompressor.Inflate(ZlibConstants.Z_FINISH);
-
- if (rc != ZlibConstants.Z_STREAM_END && rc != ZlibConstants.Z_OK)
- throw new Exception("inflating: " + decompressor.Message);
-
- if (buffer.Length - decompressor.AvailableBytesOut > 0)
- ms.Write(buffer, 0, buffer.Length - decompressor.AvailableBytesOut);
- }
- while (decompressor.AvailableBytesIn > 0 || decompressor.AvailableBytesOut == 0);
-
- decompressor.EndInflate();
- }
-
-
-