Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ public static void ReadFromEnvironmentalVariables(this ExceptionlessConfiguratio
if (String.IsNullOrEmpty(processQueueOnCompletedRequestValue)) {

// check for AWS lambda environment
if (!String.IsNullOrEmpty(GetEnvironmentalVariable("AWS_LAMBDA_FUNCTION_NAME ")))
if (!String.IsNullOrEmpty(GetEnvironmentalVariable("AWS_LAMBDA_FUNCTION_NAME")))
processQueueOnCompletedRequestValue = Boolean.TrueString;

// check for azure functions environment
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptionless/Plugins/Default/100_HeartbeatPlugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class HeartbeatPlugin : IEventPlugin, IDisposable {
/// </summary>
/// <param name="interval">The interval at which heartbeats are sent after the last sent event. The default is 1 minutes.</param>
public HeartbeatPlugin(TimeSpan? interval = null) {
_interval = interval.HasValue && interval.Value.Seconds >= 30 ? interval.Value : TimeSpan.FromMinutes(1);
_interval = interval.HasValue && interval.Value >= TimeSpan.FromSeconds(30) ? interval.Value : TimeSpan.FromMinutes(1);
}

public void Run(EventPluginContext context) {
Expand Down
4 changes: 3 additions & 1 deletion src/Exceptionless/Queue/DefaultEventQueue.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public async Task ProcessAsync() {
var batch = _storage.GetEventBatch(queueName, batchSize, maxCreatedDate);
while (batch.Any()) {
bool deleteBatch = true;
bool retryWithSmallerBatch = false;

try {
var events = batch.Select(b => b.Item2).ToList();
Expand Down Expand Up @@ -88,6 +89,7 @@ public async Task ProcessAsync() {
_log.Error(typeof(DefaultEventQueue), "Event submission discarded for being too large. The event will be retried with a smaller batch size.");
batchSize = Math.Max(1, (int)Math.Round(batchSize / 1.5d, 0));
deleteBatch = false;
retryWithSmallerBatch = true;
} else {
_log.Error(typeof(DefaultEventQueue), "Event submission discarded for being too large. The event will not be submitted.");
}
Expand Down Expand Up @@ -115,7 +117,7 @@ public async Task ProcessAsync() {
else
_storage.ReleaseBatch(batch);

if (!deleteBatch || IsQueueProcessingSuspended)
if ((!deleteBatch && !retryWithSmallerBatch) || IsQueueProcessingSuspended)
break;

batch = _storage.GetEventBatch(queueName, batchSize, maxCreatedDate);
Expand Down
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.AspNetCore/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -64,4 +64,4 @@ services.AddHttpContextAccessor()
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.Extensions.Hosting/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -42,4 +42,4 @@ for examples on sending events to Exceptionless.
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.Extensions.Logging/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -43,4 +43,4 @@ for examples on sending events to Exceptionless.
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Exceptionless.Log4net {
public class BufferingExceptionlessAppender : BufferingAppenderSkeleton {
private ExceptionlessClient _client = ExceptionlessClient.Default;
private bool _ownsClient;

public string ApiKey { get; set; }
public string ServerUrl { get; set; }
Expand All @@ -31,6 +32,7 @@ public override void ActivateOptions() {
// Rely on Logging Rules
config.SetDefaultMinLogLevel(Logging.LogLevel.Trace);
});
_ownsClient = true;
}

protected override void Append(LoggingEvent loggingEvent) {
Expand All @@ -43,5 +45,18 @@ protected override void Append(LoggingEvent loggingEvent) {

base.Append(loggingEvent);
}

public override bool Flush(int millisecondsTimeout) {
bool flushed = base.Flush(millisecondsTimeout);
return _client.ProcessQueueAsync().Wait(millisecondsTimeout) && flushed;
}

protected override void OnClose() {
base.OnClose();

_client.ProcessQueueAsync().ConfigureAwait(false).GetAwaiter().GetResult();
if (_ownsClient)
((IDisposable)_client).Dispose();
}
}
}
}
14 changes: 14 additions & 0 deletions src/Platforms/Exceptionless.Log4net/ExceptionlessAppender.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
namespace Exceptionless.Log4net {
public class ExceptionlessAppender : AppenderSkeleton {
private ExceptionlessClient _client = ExceptionlessClient.Default;
private bool _ownsClient;

public string ApiKey { get; set; }
public string ServerUrl { get; set; }
Expand All @@ -24,6 +25,7 @@ public override void ActivateOptions() {
// Rely on Logging Rules
config.SetDefaultMinLogLevel(Logging.LogLevel.Trace);
});
_ownsClient = true;
}

protected override void Append(LoggingEvent loggingEvent) {
Expand All @@ -36,5 +38,17 @@ protected override void Append(LoggingEvent loggingEvent) {

_client.SubmitFromLogEvent(loggingEvent);
}

public override bool Flush(int millisecondsTimeout) {
return _client.ProcessQueueAsync().Wait(millisecondsTimeout);
}

protected override void OnClose() {
base.OnClose();

_client.ProcessQueueAsync().ConfigureAwait(false).GetAwaiter().GetResult();
if (_ownsClient)
((IDisposable)_client).Dispose();
Comment on lines +49 to +51
}
}
}
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.Log4net/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -40,4 +40,4 @@ you can also set it on the appender like this:
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.Mvc/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -47,4 +47,4 @@ exception.ToExceptionless().Submit()
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.NLog/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -52,4 +52,4 @@ minimum log level that will be used until the client retrieves settings from the
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.Web/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -52,4 +52,4 @@ exception.ToExceptionless().Submit()
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.WebApi/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -65,4 +65,4 @@ exception.ToExceptionless().SetHttpActionContext(ActionContext).Submit()
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.Windows/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -71,4 +71,4 @@ ExceptionlessClient.Default.Configuration.SetUserIdentity("UNIQUE_ID_OR_EMAIL_AD
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
6 changes: 3 additions & 3 deletions src/Platforms/Exceptionless.Wpf/readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Exceptionless provides real-time error reporting for your apps. It organizes the
gathered information into simple actionable data that will help your app become
exceptionless!

Learn more at http://exceptionless.io.
Learn more at https://exceptionless.com/.

-------------------------------------
How to get an api key
-------------------------------------
The Exceptionless client requires an api key to use the Exceptionless service.
You can get your Exceptionless api key by logging into http://exceptionless.io
You can get your Exceptionless api key by logging into https://be.exceptionless.io/
and viewing your project configuration page.

-------------------------------------
Expand Down Expand Up @@ -70,4 +70,4 @@ ExceptionlessClient.Default.Configuration.SetUserIdentity("UNIQUE_ID_OR_EMAIL_AD
-------------------------------------
Documentation and Support
-------------------------------------
Please visit http://exceptionless.io for documentation and support.
Please visit https://exceptionless.com/docs/ for documentation and support.
21 changes: 21 additions & 0 deletions test/Exceptionless.Tests/Configuration/ConfigurationTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -220,5 +220,26 @@ public void LogLevels_GetMinLogLevel_Settings_Order() {
Assert.Equal(LogLevel.Info, settings.GetMinLogLevel("abc.def"));
Assert.Equal(LogLevel.Trace, settings.GetMinLogLevel("abc.def.ghi"));
}

[Theory]
[InlineData("AWS_LAMBDA_FUNCTION_NAME", "my-function")]
[InlineData("FUNCTIONS_WORKER_RUNTIME", "dotnet")]
public void ReadFromEnvironmentalVariables_ServerlessEnvironment_EnablesProcessQueueOnCompletedRequest(string name, string value) {
var field = typeof(ExceptionlessConfigurationExtensions).GetField("_environmentVariables", BindingFlags.NonPublic | BindingFlags.Static);
Assert.NotNull(field);
var original = field.GetValue(null);

try {
field.SetValue(null, new Dictionary<string, string> { { name, value } });

var config = new ExceptionlessConfiguration(DependencyResolver.CreateDefault());
Assert.False(config.ProcessQueueOnCompletedRequest);

config.ReadFromEnvironmentalVariables();
Assert.True(config.ProcessQueueOnCompletedRequest);
} finally {
field.SetValue(null, original);
}
}
}
}
1 change: 1 addition & 0 deletions test/Exceptionless.Tests/Exceptionless.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

<ItemGroup Condition=" '$(TargetFramework)' == 'net10.0' ">
<ProjectReference Include="..\..\src\Platforms\Exceptionless.AspNetCore\Exceptionless.AspNetCore.csproj" />
<ProjectReference Include="..\..\src\Platforms\Exceptionless.Log4net\Exceptionless.Log4net.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
Loading
Loading