Friday, August 13, 2010

Setting up the Log file locations is SharePoint 2010

Health Monitoring alerts in SP 2010 are the good things to happen to us Administrators :)

I like the way now SP 2010 gives you the pop-up alerts in Central Admin, to review and mitigate the same.

The very common issues faced in the MOSS 2007 world, was that of running out of Hard Disk space on the servers. And the weird thing about these errors, at least to the developers, were that they never pointed out to the fact that these were caused due to in-sufficient HDD space. Admins could, well look into the Event logs and see some of them, talking about DB spaces getting full. But yes, as I said, in most cases, it wasn’t obvious looking at the so called “generic error page” ------ don’t remember now ---- was it something like ------ “An error has occurred in your application….”. Not sure, but it was the most hated error page for the MOSS developers :)

So here are the alerts to the rescue. But what next !!!

What should you do when you see these kind of alerts.

Okay, check the message. In high probability, it may tell you these:

- Error message

- its severity

- a short description

- maybe, a remedy

- and the server names.

So now you know what server needs your kind attention.

If the message is about the drives running out of free spaces, then probably here are what your options could be.

#1. Provide a new Logging Directory path in IIS for that server.

#2. Also update the “Trace Log” in the Unified Logging System. You may find this in Central Admin –> Monitoring –> Reporting –> Configure Diagnostic Logging.

Modify the Path “%CommonProgramFiles%\Microsoft Shared\Web Server Extensions\14\LOGS\”

to your new locations for the log files, say, “X:\SP2010LogFiles\”.

Also, do not forget to move all the existing log files that pre-existed on the old locations and were the actual cause of disk full.

Thats it, now the new logs would be created at this new location.

Thursday, August 12, 2010

Code Samples from Microsoft for SP 2010 development in VS 2010

These sample codes have been very helpful for me in learning the new SP 2010 dev environment from within the VS 2010 IDE.

These samples demonstrate the SP 2010 development projects, tools, and techniques using VS 2010.

Has a good list of projects:

- Sequential Workflows

- BDC Samples

- Custom Action

- Event Receivers

- Web Parts and Silverlight web part.

You can download them for the Microsoft site available here.

Highlight the GridView row when you mouse-hover

Recently while working on a ASP.Net MVC project, I needed to display data in a GridView of one of the Views. I also wanted to highlight each row, as I moved my mouse over the rows of the grid.

I got to the rescue with JQuery. This is awesome, it lets you do these kind of stuffs fairly easy. Think like javascript, but needs a little different syntax. This is how it got to working:

<script type="text/javascript">
  $(document).ready(function () {
    $("tr").filter(function () {
         return $('td', this).length && ! $('table', this).length
    }).css({background: "#FFFFFF" }).hover(
     function () { $(this).css({ background: "#EEFF77" }); },
                function () { $(this).css({ background: "#FFFFFF" }); }
                );
        });
    </script>