Tag Info

Hot answers tagged

10

This has really improved in SP2010. Now you can write to the ULS logs easily even with SharePoint Foundation. All you have to do is this: SPDiagnosticsService diagSvc = SPDiagnosticsService.Local; diagSvc.WriteTrace( 0, // custom trace id new SPDiagnosticsCategory("My category", TraceSeverity.Monitorable, EventSeverity.Error), // ...


10

Logging to the ULS is the best way IMHO, it's an extensible framework and you can create your own categories. There are good examples of this in the P&P Guidance for SharePoint (spg.codeplex.com).


8

Beside the ULS log that Jaap mentions, you will also find relevant information in the "Application" Event Log. You can find Event Viewer in Administrative Tools or simply write eventvwr.exe in Run. Theres also alot of projects on Codeplex that is helpful for managing the ULS log file. Just search for ULS on Codeplex.com Finally i can recommend using ...


5

You best chance is to try at least four things while debugging: Use logging library "SharePoint Sandbox Logging" to log errors on feature activation, as you probably know logging capabilities on Sandbox are limited. Have Correlation Id with your error? contact Microsoft support Review SharePoint logs for on-premises Sandbox to check for any errors, ...


4

The "registration" of a subclass of SPDiagnosticBase requires Farm admin privileges. The registration occurs on first access. You'll need to call "DiagnosticsService.Local" in a context with Farm admin priveleges. When you ran your console app you probably ran it as a farm admin user and the registration succeeded. If you try to install your code on ...


4

Just to elaborate on Wictor's answer, his example will log 'Unknown' to the Area column. SPDiagnosticsCategory has an 'Area' property, but unfortunately its protection level is set to internal. However, you can set it using some reflection code. Listed below is an example of how to write to the SharePoint 2010 trace log using reflection. I use it in a ...


4

SharePoint does have Item-Level Auditing (at least it did in 2007, I'm assuming it's also available in 2010). This can track "views" of items. Maybe it'll help. http://msdn.microsoft.com/en-us/library/bb397403(office.12).aspx#MOSS2007ItemLevelAudit_ItemLevelAuditing


4

The 'enterprise' way to do this would be to use a proper monitoring tool such as Microsoft Operations Manager. The process I have in mind would involve: Configure SharePoint diagnostic logging such that the 'least severe' event to write to the Windows event log is [your desired severity threshold] Configure MOM to e-mail alert you whenever something is ...


4

ULS logs are generated by the server in the following folder: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\LOGS You can modify the level of logging through Central Admin e.g. more verbose or less verbose. It's a good idea to add a "12 hive" toolbar to the start bar so you can easily access logs and all the rest of SharePoint ...


4

This sounds like you're studying for TS: SharePoint 2010 Application Development 70-573. The part that says what's included are actually practices any development in SharePoint, not specific to Web Parts. It seems strange to me though, that their list doesn't include the most powerful debugging utility available to a developer - Attaching to w3wp and ...


4

You can use following PowerShell command to know all your Web Application's GUIDs. Get-SPWebApplication | Select DisplayName, Id However, bear in mind that, the GUIDs for each item in ULS logs are unique (typically for one unit of operation - like one page request) and they do not correspond directly to GUIDs of web application, unless the log suggests ...


4

Each SharePoint Server only logs message due to code running on it in ULS. So you'll have different content on each. You can use the PowerShell cmdlet Merge-SPLogFile to collect information from all servers


4

Sounds like a permission problem! Have you had any log files on that machine? I have seen before in installations, that the web application pool users dont get added to the Performance Log Users Computer > Manage > Configuration > Groups > Performance Log Users You should also check if they are members of Performance Monitor Users group as ...


4

You can use SPContext within a "RunWithElevatedPrivileges" block, but objects you get from "SPContext" such as: SPUser, SPWeb, etc. are not running in elevated privilege, they just take the current user security context. So why not just use "scweb" to get to the "Group". Since "scweb" object is initialized within the "RunWithElevatedPrivileges" block just ...


4

That is normally the line continuation character and is used whenever a particular message is too long to be included on a single line. I can't say I've ever seen it used quite like is in the picture though. According to this, it means : A trace log message can have multiple "middle" sections. Trace log messages are not guaranteed to appear ...


3

The problem is you are retrieving only SPDiagnosticsService which is provided by SharePoint Foundation out of the box. Keep in mind that these Sharepoint server provides its own Diagnostic service and being extensible other third part components can register their own diagnostic services in Sharepoint farm. The right way to get all areas is to loop through ...


3

We are using the SharePoint Guidance Library from MS Patterns & Practices - both for 2007 and 2010 projects. The SPG Library contains an excellent interface implementation of a Logging framework which is decoupled from your custom code by a Service Locator pattern making the unit testing so much easier. The SPG Library delivers a configuration framework ...


3

The alphanumeric EventID used in the ULS trace logs have no (official) reference. They are internal to the PG and its teams. I guess there will not be any list unless someone compiles their own. One of the most famous ones is 9i1u which is logged at the end of the UPS provisioning. Your only way is to Bingle the EventID and see if someone else has ...


3

You can order up your approaches as below, ULS Event Viewer Text file. I suggest, ULS - Its the SharePoint native logging and it manages to remove the older files periodically, its better to keep all the SharePoint related logs in one place "ULS". Use SPDiagnosticsService.Local.WriteTrace method in your timer job to log into the ULS logs If you find ...


2

Good question. I don't believe there is an out of the box solution, but you can install SPTraceView and choose to re-route certain events to the event log. You can then consolidate your windows events log using any of the many tools available and send out email alerts. I believe someone will need to be logged in to the server in order to run SPTraceView, ...


2

If you have multiple servers make sure you either check each of the servers or use the following powershell function to extract the error. Get-SPLogEvent | ?{$_.Correlation -eq ""} | ft Category, Message -Autosize Here is a great post from Wictor on the logs: ...


2

I always recommend that you carefully consider what you want to log and where before enabling audit logs on SharePoint. This is both due to direct performance impact from logging, and databases / log files growing out of control. You should consider what you need the data for, and expecially now that you have logged for some time, what parts of the data ...


2

I used to have your same mentality, wanting all my logging frameworks to be the same. Then i found out how much of a pain it was to get log4net working in SharePoint. Sharepoint has way too many components to get logging working easily and consistently. nlog looks like log4net, where it loads it config from a file or from code. Well if using the config file ...


2

To do this programmatically you need to change the ListViewWebPart.ViewGuid property. There is sample code in the second part of this msdn blog post. Before you start coding, have you considered using audiences? This will allow you to show different filtered lists or hide/show web parts based on the identity of the user or groups of users.


2

from the codeplex discussion site they have this - "If the duration is not being set verify the PKS Podcast List Update Handler site feature is activated, if activated de-activate and reactivate otherwise just activate." http://pks.codeplex.com/Thread/View.aspx?ThreadId=39662


2

Item Auditing can track the viewing and downloading of list items. http://msdn.microsoft.com/en-us/library/bb397403(office.12).aspx#MOSS2007ItemLevelAudit_OfficeSharePointServer2007ValueAddedSupportforAuditing


2

Tried this? using(SPWeb oWeb = SPContext.Current.Site.OpenWeb(guidWebsite)) { SPUser oUser = SPContext.Current.Web.CurrentUser; } If I misunderstood your question, and you are asking about retrieving the number of currently logged in users, Bjorn Furuknap has previously written about this here: ...


2

I think you cannot avoid the change in registry because.. Along with ULS logs the SharePoint also puts an entry into an event log. You can see your custom category into an event log also. And Windows stores Event Log categories in Registry. A better way to do is to register it along with your FEATURE as documented here: ...



Only top voted, non community-wiki answers of a minimum length are eligible