ServiceEventSource Disabled in Service Fabric Web API project

Viewed 485

I'm trying to do some logging on my service fabric web api project and it's always disabled. I've never seen this behavior before with any other SF project type.

[NonEvent]
    public void ServiceMessage(ServiceContext serviceContext, string message, params object[] args)
    {
        if (IsEnabled())
        {
            string finalMessage = string.Format(message, args);

            ServiceMessage(
                serviceContext.ServiceName.ToString(),
                serviceContext.ServiceTypeName,
                GetReplicaOrInstanceId(serviceContext),
                serviceContext.PartitionId,
                serviceContext.CodePackageActivationContext.ApplicationName,
                serviceContext.CodePackageActivationContext.ApplicationTypeName,
                serviceContext.NodeContext.NodeName,
                finalMessage);
        }
    }

IsEnabled always returns false. Is there a special setup you need to do for Web api projects? This is .net core as well. Not sure if that is effecting it.

1 Answers
Related