Elmah setup with SQL Server 2008 - elmah

I am using MVC 3 with SQL Server 2008 R2 DB.
I installed elmah 1.2.2 and SQL Server script.
Might anybody have some detailed information on how to setup Elmah with SQL Server 2008.
I checked online but could not find detailed information.

Since you have already run the SQL Server setup script and installed Elmah in your MVC application, you should just need to add the following to your web.config to have Elmah send its logs to your sql server instance.
<elmah>
...
<errorLog type="Elmah.SqlErrorLog, Elmah"
connectionStringName="<definedConnectionString>"
applicationName="MyAppName"/>
...
</elmah>
Keeping in mind that you will need to replace "<definedConnectionString>" with the name of the connection string that points to your SQl 2008 instance from your <connectionStrings> section of your web.config.
I would also recommend reading through the following 5 part series: Logging Errors with ELMAH and MVC 3, it contains a lot of great recommendations for using ELMAH with MVC. Also you might consider using installing the Elmah.MVC NuGet Package to change the default behavior of Elmah within an MVC application.

Related

ColdFusion Builder Security Code Analyzer will not run because of ColdFusion server error

I'm attempting to run ColdFusion Builder 2016's built-in Security Analyzer. It's not working.
Here's my setup
I installed ColdFusion Builder 2016 along with ColdFusion Server 2016, by using the CF Builder installer on Windows 10. I have a valid registration serial for Builder, so this is not a demo version.
I set up ColdFusion 2016 as a Windows service so that it starts up with Windows on my dev machine, and I connected it to the locally running IIS web server. I added a second registration for a ColdFusion server in my CF Builder servers panel so that I could manage the Windows service from Builder. Both of the servers (one marked as a Windows service, one not) show as running in Builder's "CF Servers" panel.
I've run the Security Analyzer before, and had no errors with it. I don't know why it doesn't work today.
Duplicating the error
When I right-click on my project, a directory, or a file, then navigate to Security Analyzer, and try to run the security analyzer, I receive this message in an alert window:
Server error: Security Code Analyzer is not available in this edition of the ColdFusion Server.
Here's what I've tried
I edited my project properties to choose the service, then to choose the non-service. Both of them produced the same error.
I noticed that CF Builder's server registrations did not have "2016" as the version number. One was blank, the other was set to "11". I changed them both to 2016 and restarted CF Builder. I switched my project to each server, back and forth, with a combination of restarting Eclipse between tests. Same error.
I also tried changing the server's port from 8600 to 80 for the Windows service, but that resulted in an expected 404 error.
I restarted my local ColdFusion server and retried the above items. Same error.
Thought
At first I thought this might be that CF Builder thinks this is a server version error. At this point, I'm wondering if the Security Analyzer does not run on the development CF Server, even though I've had it running locally before. I can't connect it to any other CF2016 servers because we have a very, very large installation of CF11 enterprise servers, and have not begun to make a server infrastructure move to CF2016 yet.
The ColdFusion 2016 Code Securiy Analyzer is only available with an Enterprise edition license. However, the EULA for ColdFusion 2016 appears to allow you to use the same license key from a production server to activate a "development" server, so you should still be able to run the Security Analyzer on your development machine.

How to configure the ColdFusion Eclipse debugger

I'm running the ColdFusion Builder 3 (Express edition) to connect to a locally running ColdFusion 9 server (windows machine).
When I set up the RDS configuration on the CF Builder and click on Test Connection everything is ok.
But when I click on Test Debugger I get the following error:
Could not initialize class coldfusion.log.CFLogs
Is this a problem with CF Builder 3 trying to access the CF 9 server?
According to this Adobe forum post they resolved the same issue by changing the port setting in ColdFusion Builder to the standard HTTP port (normally 80).
I also found this article which details the steps to setup ColdFusion debugging with Eclipse and it also has the port assigned to 80.
UPDATE:
Read this how-to article from Charlie Arehart. While it references older versions I think the same steps still apply and he mentions specific things that must be enabled on your ColdFusion server for it to work. Hope that helps.
Setting up ColdFusion Builder Step Debugging
And here is a video tutorial from Adobe's blog that steps you through the process as well.
Learn how to debug ColdFusion applications using ColdFusion Builder

Nuget custom server returns 404

I am trying to setup nuget custom server, and cannot get it list my packages.
Here is list which I verified:
Server updated to .net 4.5
OS is Windows Web Server 2008 R2
Application pool is set to integrated, dotnet set to 4.0
modules runAllManagedModulesForAllRequests="true" is present
mime map is present in web.config, and visible by IIS
I am able to download file with direct link
i am able to push package to my server
So, when I go to http://servername.com i see nice:
You are running NuGet.Server v2.7.40911.225
Click here to view your packages.
but http://servername.com/nuget returns 404. Probably there is issue with original nuget routing.
It sounds to me like the ODATA routes are just not being picked up. Did you check that nothing is overriding this at the machine.config level? You may also want to check that your package path is configured, and the web app has permission to access it.
One thing that might be easier to do is to install a third-party NuGet server such as ProGet; it's free and installs pretty easily, and also will be a bit more robust in terms of features.
(disclaimer: I work for Inedo)

Connecting ColdFusion 8 to Oracle 11g with JDBC

I created a datasource from my ColdFusion 8 admin using JDBC/Oracle Thin Client. The datasource creation was successful.
When Oracle encryption is configured as "Requested" I can browse my ColdFusion app. and run many functionalities with no problem. But when the Oracle encryption is configured as "Required" the connection fails.
The way I tested and know that it was failed was when I log in to my web app. It won't log me in. But when the Oracle is switched back as "Requested" I can log in successfully and run my tasks.
I have ColdFusion 8 Enterprise version and the operating system is Unix.
From the network dept, I was told they have the correct JAR file in place but not sure what is the correct JAR file.
Currently my web apps are running with datasource created using Oracle Thin Clint but the Oracle encryption needs to be switched back to "Requested" otherwise my users are complaining that they can't log in.
Has anyone ever experienced this situation and found a solution?
What should I do so I can use Oracle encryption set to "Required"?
I believe you are looking for the ojdbc14.jar file in the ColdFusion8/wwwroot/WEB-INF/lib directory (this will work with 11g).
I would give Coldfusion a restart but it might not be unnecessary.
Navigate to your Coldfusion Administrator.
In the ColdFusion Administration under data sources. Add a new data source along with your credentials and choose Other from the Database driver options.
Then enter this: jdbc:oracle:thin:#10.10.10.11:1521:ORCL in the JDBC URL Textarea.
In the Driver Class textfield enter oracle.jdbc.OracleDriver.
If you need a different jar (not sure you will) but if you do you can down load it from here.
http://www.oracle.com/technetwork/indexes/downloads/index.html
Hope this is helpful or at least gets you further along.
Frank, Thank you for the answer but the java version running on my CF server is JAVA1.6 and the ojdbc.jar that's installed in there is ojdbc6.jar
Should the version of ojdbc.jar and java be the same? If I am already in the right track with my ojdbs.jar and java files then I'm back to square one
In addition, my further test using Oracle encryption as "Requested", I can run my apps. just fine except when my CF made a call to a str. procedure, it did not return a result. So I got CF error.
From me googling this issue, I found a blog that says this is a problem on CF standard version when using Oracle Thin Client. My CF is Enterprise edition.
I'm confused...is this related? how can I make this work?

ELMAH doesn't insert error logs to SQL DB on production

I have configured an SQL Server 2008 R2 db for ELMAH as described and works fine on development but not production. Both development and production connection string targets to same db, profiler shows nothing for the insert SP if I run production web site. I do not think its a SQL related problem. I have read some posts like
Elmah not working on IIS7 server
Elmah 1.2 does not log to SQL on Windows 2008 IIS7.5 Integrated mode (but works locally)
but even we have same problem, none of them helped me.
Both websites work on Windows Server 2008 R2 / .net 4.
Any ideas? TIA.
UPDATE : The only difference is my web site works integrated mode on development, and classic on on production. If I change classic to integrated it works fine.
So ELMAH doesn't work on classic mode?
it's probably problem with permissions to stored procedure.
use following script to give execute permission to the user (from connection string in productive system)
GRANT EXECUTE ON ELMAH_GetErrorsXml TO USER_NAME
GRANT EXECUTE ON ELMAH_GetErrorXml TO USER_NAME
GRANT EXECUTE ON ELMAH_LogError TO USER_NAME