how to Enable Debug logs in All components in WSO2 IS? - wso2-identity-server

how to Enable Debug logs in All components in WSO2 IS?
I want to track code running.
Could you tell me what config I need add ?
Thanks
henry

You can turn the logs in WSO2IS by making all the logs into debug level in Log4j configurations. To do that
Go to //repository/conf directory
Open log4j2.properties file
In there you can find loggers=AUDIT_LOG, trace-messages, org-apache-coyote,... field make sure to add all the Java package names there
Change the log level in every package to 'DEBUG'. as an example
logger.org-apache.name = org.apache
logger.org-apache.level = DEBUG
logger.org-apache.additivity = false
logger.org-apache.appenderRef.CARBON_LOGFILE.ref = CARBON_LOGFILE
After that you can find that all the debug logs have being visible in the terminal.

Related

One or more services have started or stopped unexpectedly SPTimerService (SPTimerV4)

I have stop and restart services(Sharepoint Administration & Sharepoint Timer Service)
I cleaned the Configuration Cache by using mentioned steps.
Summary of the steps to clear the timer job:
Stop SharePoint Timer service on all servers in the farm.
Browse to C:\ProgramData\Microsoft\SharePoint\Config{GUID} where the {GUID} folder contains a bunch of XML files and NOT the files with a “.PERSITEDFILE” extension.
Delete all the XML files
Update the contents of the Cache.ini file to just say “1” (without quotes).
Restart the SharePoint Timer service on each server
Reanalyze the issue in Health Analyzer
Does anyone know why this keeps occurring and how I can stop it?
First of all try and check your ULS Logs and see if there is any error that arise.
Secondly try and maybe check the event viewer on your SharePoint server to see if any errors are shown and make sure you have enough disk space available.
and also you might want to check this :Clearing Timer Services
Let me know if you see any error post it here.
hope it helps.
Yotam.

WSO2 BAM 2.5 - Default Logger Output Event Adaptor

Which directory and file does the default logger output event adaptor write the logs to? I am not able to see the logs in the repository/logs/wso2carbon.log file? The log4j properties file in repository/conf has the default configurations and I can see the mention of wso2carbon.log there. Are there any additional configurations necessary? Please help.
It is stored in wso2carbon.log file and also log output adapter should print event logs in terminal console as well.
You can download the log file by System Logs which is located Carbon Management Console > Monitor > System Logs > Show archived logs

Unable to start a C++ Windows Service

I tried creating a Windows service in C++ using this code sample on MSDN. I opened the solution file in Visual Studio 2013 as admin. The build was successful. Then I installed the service, as per the description provided with the code sample, from a command prompt opened as administrator. The service is now shown in the Services tool in my system. However, when I try to start the service, I get error 5: Access is denied.
The output of sc qc CppWindowsService is as follows:
[SC] QueryServiceConfig SUCCESS
SERVICE_NAME: CppWindowsService
TYPE : 10 WIN32_OWN_PROCESS
START_TYPE : 3 DEMAND_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : C:\Users\Aaa\Documents\CppWindowsService\C++\Debug\CppWindowsService.exe
LOAD_ORDER_GROUP :
TAG : 0
DISPLAY_NAME : CppWindowsService Sample Service
DEPENDENCIES :
SERVICE_START_NAME : NT AUTHORITY\LocalService
Why does this happen, and how can I fix it?
Because the executable file is in your personal Documents folder, the local service account doesn't have access to it.
The easiest resolution would be to change the permissions on the Debug folder to give SERVICE read and execute access, with inheritance enabled. From the command line:
icacls Debug /grant SERVICE:(OI)(CI)(RX)
(Because Windows does not do traverse checking in the default configuration, you do not need to change the permissions for the parent folders.)
Another option is to copy the executable file to a public location (such as inside Program Files) and install it there, but you then have to remember to manually update the copy each time you recompile.
Edit: yet another option, as you suggest, is to change the account to local system so that the service is running with administrative privileges. Best practice is to run services with the least privilege necessary, but at this stage it doesn't matter much.
The comment provided by #Pumkko helped to solve the issue... The service account was specified as LocalService (#define SERVICE_ACCOUNT L"NTAUTHORITY\\LocalService"). From here:
The Local Service account didn't have permissions to the output .exe
file, and this was why the error was occuring.
I changed the account type to LocalSystem (#define SERVICE_ACCOUNT L"LocalSystem") and now my service can be started.
Thankyou #Pumkko and #Harry Johnston.

How to configure wso2 servers logging the same level of detail as console output in wso2carbon.log file

When we run the bin/wso2server.sh file in a terminal, we get nice verbose logging output in the same terminal which is very useful for debugging. But the output in the repository/log/wso2carbon.log file is minimal. I have checked all the other files in the repository/log/ directory and none have the same level of verbosity as the console output.
I tried settings under Home > Configure > Logging after logging in to the management console of wso2 application server. Specifically I set the settings for "Configure Log4J Appenders" for CARBON_LOGFILE to be the same as for CARBON_CONSOLE but this did not have desired effect. The web application level info and debug messages are shown on the terminal from where we started the wso2 application server but this is not shown in the wso2carbon.log file.
How do we get the same level of detail i.e. verbose output like we get in the terminal into the repository/log/wso2carbon.log file?
I tried a lot of changes via the "Home > Configure > Logging" of the WSO2 web based management console, to get the same level of detail as the console into the logfile but none had the desired effect. In fact I observed that even though I changed the Log Pattern of CARBON_LOGFILE to [%d] %5p - %x %m {%c}%n I still kept getting logs in the TID: [0] [AS] [2013-08-23 15:11:10,025] format in the repository/logs/wso2carbon.log file. There is definitely some problem with setting log file detail level and pattern via the web based management console at least on version wso2as 5.0.1
So I ended up hacking the bin/wso2server.sh file.
I changed the line
nohup bash $CARBON_HOME/bin/wso2server.sh > /dev/null 2>&1 &
under both start and restart sections to
nohup bash $CARBON_HOME/bin/wso2server.sh > $CARBON_HOME/repository/logs/wso2carbon.log 2>&1 &
Now I am getting same logs as console in the file.
I know its a hack but atleast I am able to get the detailed debug logs in a file for offline analysis.
Hope someone from wso2 looks into the issue of log level & pattern setting via the web based management console and solves it..
By default the console output and the wso2carbon.log file should be the same. I checked and both have the same output. In "Configure Log4J Appenders" see whether you have DEBUG as the Threshold for both CARBON_LOGFILE and CARBON_CONSOLE.

Build never starts on TFS2012

I'm attempting to set up some build controllers and agents in our TFS infrastructure. Our TFS server is setup as a build controller, and I have a few build agents set up as well.
When I queue a new build on my system, all appears to be well. No error messages appear, and the build appears in the queue on my system. However, that's all that ever happens. When I go to the page for the build in Visual Studio, it states it's been "Running for 0 seconds". Looking at the admin console on our TFS server, the controller states it's "Ready", but nothing more. All the agents are similarly listed as 'Ready'.
I'm not aware of any logs I can use to diagnose this issue. I've set the Logging Verbosity to 'Diagnostic', but options in the Diagnostics dropdown are greyed out. The activity is completely blank, as well.
Looking in the database on the build controller, the dbo.tbl_BuildController table does list the build. What I find odd, though, is the StartTime is NULL. If I stop the build in VS, the start time and the end time are set to the same thing in the database.
So, I know that the build is registering with the build controller, and that there's not a communication issue; the build just never starts, and never give an error. How can I resolve this? (or, at least get an error that I can chase down).
EDIT: The issue appears to be related to the TFS server. Here's what I uncovered in the event log:
WebHost failed to process a request.
Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/10411892
Exception: System.ServiceModel.ServiceActivationException: The service '/tfs/queue/GPA/Services/v4.0/MessageQueueService2.svc' cannot be activated due to an exception during compilation. The exception message is: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item. ---> System.ArgumentException: This collection already contains an address with scheme http. There can be at most one address per scheme in this collection. If your service is being hosted in IIS you can fix the problem by setting 'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled' to true or specifying 'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
Parameter name: item
at System.ServiceModel.UriSchemeKeyedCollection.InsertItem(Int32 index, Uri item)
at System.Collections.Generic.SynchronizedCollection1.Add(T item)
at System.ServiceModel.UriSchemeKeyedCollection..ctor(Uri[] addresses)
at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(Type serviceType, Uri[] baseAddresses)
at System.ServiceModel.Activation.ServiceHostFactory.CreateServiceHost(String constructorString, Uri[] baseAddresses)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.CreateService(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.ActivateService(ServiceActivationInfo serviceActivationInfo, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
--- End of inner exception stack trace ---
at System.ServiceModel.ServiceHostingEnvironment.HostingManager.EnsureServiceAvailable(String normalizedVirtualPath, EventTraceActivity eventTraceActivity)
at System.ServiceModel.ServiceHostingEnvironment.EnsureServiceAvailableFast(String relativeVirtualPath, EventTraceActivity eventTraceActivity)
Process Name: w3wp
Process ID: 3756
I would start looking in the Event Log.
Control Panel -> Administrative Tools
Event Viewer
I am assuming that there will be some sort or error appearing in there. If your build agents are on a different machine, make sure you look in the event log there too.
Update from original posters comments
There was an exception in the Event Log which pointed us to here: TFS2012 Build Service offline
Go check the security settings of the user that is used for the build service properties. I've had almost the same issue and it was because I changed some security settings for that specific user where he suddenly could not build anymore.
To find the user:
Go to your TFS server
Open Team Foundation Server Administration Console
Open Build Configuration
Open Properties of the Build Service
This worked for me, password of the user account which was used to access TFS hosted on different Server expired.
Password reset fixed it for me.
The build controller and agent must run the same version of Team Foundation Build.
(Buid Service version is something like v4.0 or v4.1 and it is different from tfs product version which is some thing like 11.0.50727.1)
So, if the build Agent and controller are deployed in different machines, check the build service version on both machines. it must be the same.
TFS prevents to assign a build agent to a build controller with different build service version. However, you are allowed to upgrade one of the build machines to a different version (for example visual studio update 2) without detaching the controller and agent
in some cases the build service version stay unchanged (for example inspite of upgrading to update 2 the version stay v4.0)
in this situation if you want to apply the new version of build service
in tfs 2012 or 2013 to check the build service version:
Go to Build Machine
Open Team Foundation Server Administration Console
Open Build Configuration
Open Build Service properties (click on the properties link next to the unregister
link)
"Listen for build agent communication on" text box
to apply change of the build service version
stop the service
Click the "Change" button
set a different port number
reset the previous port number
immediately the build service version will change from v4.0 to v4.1