-
Notifications
You must be signed in to change notification settings - Fork 462
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for filtering/processing log streams (#996)
* Add filtering support for streaming logs * Add LogsProvider tests * Add LogsProcessor tests * Fix tests
- Loading branch information
1 parent
09ccdb9
commit 75d7460
Showing
11 changed files
with
304 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.Core/logs/ModuleLogMessage.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 23 additions & 2 deletions
25
edge-agent/src/Microsoft.Azure.Devices.Edge.Agent.IoTHub/stream/LogsStreamRequest.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,37 @@ | ||
// Copyright (c) Microsoft. All rights reserved. | ||
namespace Microsoft.Azure.Devices.Edge.Agent.IoTHub.Stream | ||
{ | ||
using System.ComponentModel; | ||
using Microsoft.Azure.Devices.Edge.Agent.Core.Logs; | ||
using Microsoft.Azure.Devices.Edge.Util; | ||
using Newtonsoft.Json; | ||
|
||
public class LogsStreamRequest | ||
{ | ||
public LogsStreamRequest(string schemaVersion, string id) | ||
public LogsStreamRequest(string schemaVersion, string id, LogsContentEncoding encoding, LogsContentType contentType, ModuleLogFilter filter) | ||
{ | ||
this.SchemaVersion = schemaVersion; | ||
this.Id = id; | ||
this.Id = Preconditions.CheckNonWhiteSpace(id, nameof(id)); | ||
this.Filter = filter ?? ModuleLogFilter.Empty; | ||
this.Encoding = encoding; | ||
this.ContentType = contentType; | ||
} | ||
|
||
[JsonProperty("schemaVersion")] | ||
public string SchemaVersion { get; } | ||
|
||
[JsonProperty("id")] | ||
public string Id { get; } | ||
|
||
[JsonProperty("encoding", DefaultValueHandling = DefaultValueHandling.Populate)] | ||
[DefaultValue(LogsContentEncoding.None)] | ||
public LogsContentEncoding Encoding { get; } | ||
|
||
[JsonProperty("contentType", DefaultValueHandling = DefaultValueHandling.Populate)] | ||
[DefaultValue(LogsContentType.Text)] | ||
public LogsContentType ContentType { get; } | ||
|
||
[JsonProperty("filter")] | ||
public ModuleLogFilter Filter { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.