Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable Logging in Console #908

Open
reeceengle opened this issue Sep 10, 2019 · 1 comment
Open

Disable Logging in Console #908

reeceengle opened this issue Sep 10, 2019 · 1 comment

Comments

@reeceengle
Copy link

What version of PushSharp are you using?

4.0.10

Describe your issue:

Is there a way to disable PushSharp's console logging?

Just upgraded from PushSharp 2->4.0.10 and we are seeing a lot of logging in the console. At load, this is causing a lot of new slowness that is degrading the performance of some high-traffic tasks.

What are the steps required to reproduce this issue?

Using the ApnsPushBroker and queueing notifications.

Please provide any Exception Stack Traces

2019-09-10 21:37:47.PM [INFO] Stopping: Waiting on Tasks
2019-09-10 21:37:47.PM [INFO] Waiting on all tasks 1
2019-09-10 21:37:48.PM [INFO] APNS-Client[340]: Sending Batch ID=1, Count=1
2019-09-10 21:37:48.PM [INFO] APNS-Client[340]: Connecting (Batch ID=1)
2019-09-10 21:37:48.PM [INFO] APNS-Client[340]: Connected (Batch ID=1)
2019-09-10 21:37:48.PM [INFO] APNS-Client[340]: Sent Batch, waiting for possible response...
2019-09-10 21:37:49.PM [INFO] APNS-Client[340]: Received -1 bytes response...
2019-09-10 21:37:49.PM [INFO] APNS-Client[340]: Batch (ID=1) completed with no error response...
2019-09-10 21:37:49.PM [INFO] APNS-Client[340]: Done Reading for Batch ID=1, reseting batch timer...
2019-09-10 21:37:49.PM [INFO] All Tasks Finished
2019-09-10 21:37:49.PM [INFO] Passed WhenAll
2019-09-10 21:37:49.PM [INFO] Broker IsCompleted
2019-09-10 21:37:49.PM [DEBUG] Broker Task Ended
2019-09-10 21:37:49.PM [INFO] Stopping: Done Waiting on Tasks
2019-09-10 21:37:49.PM [DEBUG] Scaled Changed to: 1
2019-09-10 21:37:49.PM [INFO] Stopping: Waiting on Tasks
2019-09-10 21:37:49.PM [INFO] Waiting on all tasks 1
2019-09-10 21:37:50.PM [INFO] APNS-Client[341]: Sending Batch ID=1, Count=1
2019-09-10 21:37:50.PM [INFO] APNS-Client[341]: Connecting (Batch ID=1)
2019-09-10 21:37:52.PM [INFO] APNS-Client[341]: Connected (Batch ID=1)
2019-09-10 21:37:52.PM [INFO] APNS-Client[341]: Sent Batch, waiting for possible response...
2019-09-10 21:37:53.PM [INFO] APNS-Client[341]: Received -1 bytes response...
2019-09-10 21:37:53.PM [INFO] APNS-Client[341]: Batch (ID=1) completed with no error response...
2019-09-10 21:37:53.PM [INFO] APNS-Client[341]: Done Reading for Batch ID=1, reseting batch timer...
2019-09-10 21:37:53.PM [INFO] All Tasks Finished
2019-09-10 21:37:53.PM [INFO] Passed WhenAll
2019-09-10 21:37:53.PM [INFO] Broker IsCompleted
2019-09-10 21:37:53.PM [DEBUG] Broker Task Ended
2019-09-10 21:37:53.PM [INFO] Stopping: Done Waiting on Tasks
2019-09-10 21:37:53.PM [DEBUG] Scaled Changed to: 1
2019-09-10 21:37:53.PM [INFO] Stopping: Waiting on Tasks
2019-09-10 21:37:53.PM [INFO] Waiting on all tasks 1
2019-09-10 21:37:53.PM [INFO] All Tasks Finished
2019-09-10 21:37:53.PM [INFO] Passed WhenAll
2019-09-10 21:37:53.PM [INFO] Broker IsCompleted
2019-09-10 21:37:53.PM [DEBUG] Broker Task Ended
2019-09-10 21:37:53.PM [INFO] Stopping: Done Waiting on Tasks
2019-09-10 21:37:53.PM [DEBUG] Scaled Changed to: 1
2019-09-10 21:37:53.PM [INFO] Stopping: Waiting on Tasks
2019-09-10 21:37:53.PM [INFO] Waiting on all tasks 1
2019-09-10 21:37:53.PM [INFO] All Tasks Finished
2019-09-10 21:37:53.PM [INFO] Passed WhenAll
2019-09-10 21:37:53.PM [INFO] Broker IsCompleted
2019-09-10 21:37:53.PM [DEBUG] Broker Task Ended
2019-09-10 21:37:53.PM [INFO] Stopping: Done Waiting on Tasks
2019-09-10 21:37:53.PM [DEBUG] Scaled Changed to: 1
2019-09-10 21:37:53.PM [INFO] Stopping: Waiting on Tasks
2019-09-10 21:37:53.PM [INFO] Waiting on all tasks 1
2019-09-10 21:37:54.PM [INFO] APNS-Client[342]: Sending Batch ID=1, Count=1
2019-09-10 21:37:54.PM [INFO] APNS-Client[342]: Connecting (Batch ID=1)
2019-09-10 21:37:54.PM [INFO] APNS-Client[342]: Connected (Batch ID=1)
2019-09-10 21:37:54.PM [INFO] APNS-Client[342]: Sent Batch, waiting for possible response...
2019-09-10 21:37:55.PM [INFO] APNS-Client[342]: Received -1 bytes response...
2019-09-10 21:37:55.PM [INFO] APNS-Client[342]: Batch (ID=1) completed with no error response...
2019-09-10 21:37:55.PM [INFO] APNS-Client[342]: Done Reading for Batch ID=1, reseting batch timer...
2019-09-10 21:37:55.PM [INFO] All Tasks Finished
2019-09-10 21:37:55.PM [INFO] Passed WhenAll
2019-09-10 21:37:55.PM [INFO] Broker IsCompleted
2019-09-10 21:37:55.PM [DEBUG] Broker Task Ended
2019-09-10 21:37:55.PM [INFO] Stopping: Done Waiting on Tasks
2019-09-10 21:37:55.PM [DEBUG] Scaled Changed to: 1
2019-09-10 21:37:55.PM [INFO] Stopping: Waiting on Tasks
2019-09-10 21:37:55.PM [INFO] Waiting on all tasks 1
2019-09-10 21:37:55.PM [INFO] All Tasks Finished
2019-09-10 21:37:55.PM [INFO] Passed WhenAll
2019-09-10 21:37:55.PM [INFO] Broker IsCompleted
2019-09-10 21:37:55.PM [DEBUG] Broker Task Ended
2019-09-10 21:37:55.PM [INFO] Stopping: Done Waiting on Tasks
2019-09-10 21:37:55.PM [DEBUG] Scaled Changed to: 1
2019-09-10 21:37:55.PM [INFO] Stopping: Waiting on Tasks
2019-09-10 21:37:55.PM [INFO] Waiting on all tasks 1
2019-09-10 21:37:56.PM [INFO] APNS-Client[343]: Sending Batch ID=1, Count=1
2019-09-10 21:37:56.PM [INFO] APNS-Client[343]: Connecting (Batch ID=1)
2019-09-10 21:37:56.PM [INFO] APNS-Client[343]: Connected (Batch ID=1)
2019-09-10 21:37:56.PM [INFO] APNS-Client[343]: Sent Batch, waiting for possible response...
2019-09-10 21:37:57.PM [INFO] APNS-Client[343]: Received -1 bytes response...
2019-09-10 21:37:57.PM [INFO] APNS-Client[343]: Batch (ID=1) completed with no error response...
2019-09-10 21:37:57.PM [INFO] APNS-Client[343]: Done Reading for Batch ID=1, reseting batch timer...
2019-09-10 21:37:57.PM [INFO] All Tasks Finished
2019-09-10 21:37:57.PM [INFO] Passed WhenAll
2019-09-10 21:37:57.PM [INFO] Broker IsCompleted
2019-09-10 21:37:57.PM [DEBUG] Broker Task Ended
2019-09-10 21:37:57.PM [INFO] Stopping: Done Waiting on Tasks

@jaoord
Copy link

jaoord commented Sep 10, 2020

Take a look here to find out how to disable the console logger.

Relevant code in case link dies:

public void ConfigureServices(IServiceCollection services)
{
    services.AddLogging(config =>
    {
        // clear out default configuration
        config.ClearProviders();

        config.AddConfiguration(Configuration.GetSection("Logging"));
        config.AddDebug();
        config.AddEventSourceLogger();
        
        if(Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT") == EnvironmentName.Development) 
        {
        	config.AddConsole();
        }
    });

    ... 
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants