Logs are not being sent to stackdriver using Stackdriver log4net integration - asp.net

I'm trying to use the Google.cloud.logging.log4net library in a .NET Web application to send logs to Google Stackdriver. I've followed the steps from stackdriver logging how to guide Option 2 https://cloud.google.com/logging/docs/integrate/dotnet
It seems to work from my local machine when I provide the service account credentials. But it does not send logs when I run it from a GCE instance.

Related

com.google.cloud.datastore.DatastoreException: Unauthenticated

I have a GKE cluster where my application is running. My application is built using springboot. And I have google Datastore database which is running in a separate GCP Project.
It throws the error "DatastoreException: Unauthenticated" when it tries to connect to datastore database during application start-up.
The connection happens through "Service account" permissions, application service account having necessary(Datastore user) permission to the datastore database. But it still fails.
Below two are the similar scenarios where it works:
1.
With similar set-up in a lower environment, it works.
2.
I have another application running inside same GKE cluster which is using the same service account but connecting to another datastore database with similar role to the service account, it works fine here.

ServiceDataPublisherAdmin not set in wso2 api manager gateway

I am setting up wso2 API manager 1.10.x with DAS 3.0.1 for publishing API statistics using mysql. My API manager system is clustered with gateway worker node on a separate VM. I followed the documents to enable analytics for API manager via UI. I also followed this document to manually enable analytics for gateway worker node. http://blog.rukspot.com/2016/05/configure-wso2-apim-analytics-using-xml.html After setup, I restart all servers, everything seems fine. But when I make a request to published API, gateway does not publish any statistics to DAS receiver. No data in DAS summary tables either.
By debugging wso2 Gateway, I am able to narrow it down to the fact that
private static ServiceDataPublisherAdmin dataPublisherAdminService; inside org.wso2.carbon.apimgt.impl.internal.APIManagerComponent never get set. Therefore APIMgtUsageHandler does not do anything.
Any idea on what could cause this to happen?
Thanks.
Figured it out myself.
bundle org.wso2.carbon.statistics_4.4.8 and 2 other statistics bundles are necessary for gateway worker to publish statistics data to DAS. But worker profile provided in the package of wso2 API manager 1.10.0 had them excluded.
To work around it, start wso2 on worker node with -Dprofile=default.
You can use osgi console to confirm the activation of these bundles. Once the bundle is activated, class inside is instantiated, gateway will start to publish statistics to DAS when you invoke a published API.

Azure Management API with service principal: The subscription '[...]' could not be found

I have created a subscription with Azure Germany, and now I am attempting to deploy my application topology there using the Azure Management API and a service principal.
Deployment works fine towards the "regular" Azure cloud, however when I attempt to deploy towards my subscription in Azure Germany, I get the following error message: The subscription '[...]' could not be found.
I am able to successfully acquire an authentication token using AuthenticationContext.AcquireTokenAsync(), and I am using "https://login.microsoftonline.de/[directoryId]" as authority and "https://management.core.cloudapi.de/" as resource. Additionally, I am using "Germany Northeast" as location/region.
The error occurs as soon as I attempt to perform a typical management task, such as creating a resource group.
I have checked the following things:
App registration settings
App permissions (Windows Azure Active
Directory + Windows Azure Service Management API)
Correctness of
subscription id, app id, and app secret/key
I am at a loss at what could be wrong. What could be causing this error message?
you should point your app to correct subscription first.
Try setting subscription using this link.
Add Microsoft Graph permissions to your Azure AD app.

Stackdriver logs not available for Cloud ML jobs since migration to V2

Since migration to V2 logs from Cloud ML jobs are not accessible on the Stackdriver logging console anymore. The last log displayed is
Waiting for Tensorflow to start.
The job is executed and completed successfully, I just can't access outputs in the logs
All Stackdriver APIs are enabled for the project.
There are no known issues with Cloud ML's Stackdriver logging. The fact that you see "Waiting for Tensorflow to start." indicates you are seeing log messages from Cloud ML.
If logs from your Python/TensorFlow program are missing that usually indicates Cloud ML hasn't been authorized to send logs to Stackdriver logging for your project. To check permissions do the following
Identify the Cloud ML service account by following these instructions
In the Cloud Console select the IAM Tab
Verify that the Cloud ML service account is listed and has Logs Writer permissions
This problem also took me two weeks to search answers online with frustration, until I came across this post. I did not see "migration to V2" as OP mentions but I simply could not get any application logs in StackDriver, only system logs of job started/completed. Following what Jeremy replies solves the problem.
To make Jeremy's reply simpler to follow, essentially you add the ML service account
cloud-ml-service#<project-id>.iam.gserviceaccount.com
to your project's IAM members, with at least "Logs Writer" role.
You can get "project-id" by:
gcloud config list project --format "value(core.project)"
I also assigned Project->Editor role to allow Bucket access.

SignalR Azure Cloud Service with Service Bus

I have built a simple Chat application using SignalR followed the tutorial there, which works great.
Then I followed the tutorial of SignalR Scaleout with Azure Service Bus, also from Microsoft.
So I have completed all the following steps:
Created a new Cloud Service on Azure Portal
Created a new Service Bus namespace on Azure Portal
Created a Windows Azure Cloud Service with a SignalR ASP.NET Web Role
Setup the SignalR Web Role running on 2 instances (VM Size: Small)
Deployed the Cloud Service to the Azure Cloud Service.
But I can't get the SignalR Chat application to work. Can't start the hub.
I noticed it tried to use longPolling and shows status Cancelled/Abort in the browser's debugging tool (Chrome) with the following error in the console:
WebSocket connection to 'ws://example.cloudapp.net/signalr/connect?transport=webSockets&clientProtocol=1.5&connectionToken=KOlz9psd6yCqvYjmCbI3ch5mrXcP%2BAAl3JVMFaP24p2Cv%2FyRb94D5uE27SO9Bz%2B5Itba4vADtv3%2Btv2FMF9LJI6Zxr026UJYxDPNQMVpFTw2hiHd&connectionData=%5B%7B%22name%22%3A%22schathub%22%7D%5D&tid=10' failed: Error during WebSocket handshake: Unexpected response code: 400
and this is the log in the Network:
Do I need to do anything extra besides all the steps listed in the tutorial to make this work?
Based on the current Pricing, you need to set the Service bus to at least Standard tier to support Topics.
In this case, I did create my service bus choosing Standard tier, although it shows Standard on it's Overview page under the "Pricing tier" section, I have to specifically go to the settings and scaled it up from Basic to Standard. Which has solved the problem.

Resources