How to write to windows event logs from determinations-server under IIS

This is just an FYI technical bit of information I wish someone had shared with me before I started trying to write OPA errors to the windows event log... Most problems writing to the windows event log from log4net occur because of permissions. Some problems are because determinations-server does not have permissions to create some registry entries. Some problems cannot be resolved unless specific registry entry permissions are actually changed. We had very little consistency with the needed changes across our servers, but some combination of the following would always get the logging to the windows event log working.
To see log4net errors as log4net attempts to utilize the windows event log, temporarily add the following to the web.config:
<appSettings>
<!-- uncomment the following line to send diagnostic messages about the log configuration file to the debug trace.
Debug trace can be seen when attached to IIS in a debugger, or it can be redirected to a file, see
http://logging.apache.org/log4net/release/faq.html in the section "How do I enable log4net internal debugging?" -->
<add key="log4net.Internal.Debug" value="true"/>
</appSettings>
<system.diagnostics>
<trace autoflush="true">
<listeners>
<add
name="textWriterTraceListener"
type="System.Diagnostics.TextWriterTraceListener"
initializeData="logs/InfoDSLog.txt" />
</listeners>
</trace>
</system.diagnostics>
To add an appender for the windows event viewer, try the following in the log4net.xml:
<appender name="EventLogAppender" type="log4net.Appender.EventLogAppender" >
<param name="ApplicationName" value="OPA" />
<param name="LogName" value="OPA" />
<param name="Threshold" value="all" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
<filter type="log4net.Filter.LevelRangeFilter">
<levelMin value="WARN" />
<levelMax value="FATAL" />
</filter>
</appender>
<root>
<level value="warn"/>
<appender-ref ref="EventLogAppender"/>
</root>
To put the OPA logs under the Application Event Log group, try this:
Create an event source under the Application event log in Registry Editor. To do this, follow these steps:
1.     Click Start, and then click Run.
2.     In the Open text box, type regedit.
3.     Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application
4.     Right-click the Application subkey, point to New, and then click Key.
5.     Type OPA for the key name.
6.     Close Registry Editor.
To put the OPA logs under a custom OPA Event Log group (as in the demo appender above), try this:
Create an event log in Registry Editor. To do this, follow these steps:
1.     Click Start, and then click Run.
2.     In the Open text box, type regedit.
3.     Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
4.     Right-click the eventlog subkey, point to New, and then click Key.
5.     Type OPA for the key name.
6.     Right-click the new OPA key and add a new DWORD called "MaxSize" and set it to "1400000" which is about 20 Meg in order to keep the log file from getting too large.
7.     The next steps either help or sometimes cause an error, but you can try these next few steps... If you get an error about a source already existing, then you can delete the key.
8.     Right-click the OPA subkey, point to New, and then click Key.
9.     Type OPA for the key name.
10.     Close Registry Editor.
You might need to change permissions so OPA can write to the event log in Registry Editor.  If you get permission errors, try following these steps:
1.     Click Start, and then click Run.
2.     In the Open text box, type regedit.
3.     Locate the following registry subkey:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
4.     Right-click the EventLog key, select Permissions.
5.     In the dialog that pops up, click Add...
6.     Click Advanced...
7.     Click Locations... and select the current machine by name.
8.     Click Find Now
9.     Select both the Network user and IIS_IUSERS user and click OK and OK again. (We never did figure out which of those two users was the one that fixed our permission problem.)
10.     Change the Network user to have Full Control
11.     Click Apply and OK
To verify OPA Logging to the windows event logs from Determinations-Server:
Go to the IIS determinations-server application within Server Manager.
Under Manage Application -> Browse Application click the http link to pull up the local "Available Services" web page that show the wsdl endpoints.
Select the /determinations-server/server/soap.asmx?wsdl link
Go to the URL and remove the "?wsdl" from the end of the url and refresh. This will throw the following error into the logs:
ERROR Oracle.Determinations.Server.DSServlet [(null)] - Invalid get request: /determinations-server/server/soap.asmx
That error should show up in the windows event log, OR you can get a message explaining why security stopped you in "logs/InfoDSLog.txt" if you used the web.config settings from above.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363648(v=vs.85).aspx
Edited by: Paul Fowler on Feb 21, 2013 9:45 AM

Thanks for sharing this information Paul.

Similar Messages

  • Operations Manager Failed to Access the Windows Event Log and management server is showing warning state

    Hi,
    I am monitoring AD server from SCOM 2012 R2. My management server goes into waning state. When i run Health explorer then it come back in the healthy state but after some time it again goes into warning state. After seeing alert i found that a alert is coming
    again and again i.e.  Operations Manager Failed to Access the Windows Event Log.The description of alert is mention below
    The Windows Event Log Provider is still unable to open the DhcpAdminEvents event log on computer 'nc2vws12ad5.corp.nathcorp.com'.
    The Provider has been unable to open the DhcpAdminEvents event log for 64080 seconds.
    Most recent error details: The RPC server is unavailable.
    Please suggest me how to resolve this so that my management server will again come back in healthy state.
    Thanks
    Abhishek

    Hi Abhishek,
    As i mentioned earlier the Alert resolution says the same points.
    Can you give details on the below ?
    Is there really a log named "Dhcpadminevents" in the MS's Event viewer ?
    Did you recently configure any new alert where you mentioned "Dhcpadminevents"
    as a event log location ?
    If yes then what is the target you selected for the rule / monitor there ?
    Can you post the results for analysis ?
    Gautam.75801

  • Lots of Anyconnect Error Message in Windows Event Log

    Hi Community.
    We have lots of Anyconnect Error Messages in the Windows Event Log. Following two examples.
    Can anyone tell me why these errors appears and how do I fix them ? I already installed the newest Anyconnect on my machine.
    Thanks in advance and Kind Regards Patrick
    Example 1
      <Provider Name="acvpnagent" />
      <EventID Qualifiers="9216">2</EventID>
      <Keywords>0x80000000000000</Keywords>
      <EventRecordID>97564</EventRecordID>
      <Channel>Cisco AnyConnect Secure Mobility Client</Channel>
    - <EventData>
      <Data>Function: CNetEnvironment::logProbeFailure File: .\NetEnvironment.cpp Line: 1432 Invoked Function: CHttpProbeAsync::SendProbe Return Code: -27066354 (0xFE63000E) Description: HTTP_PROBE_ASYNC_ERROR_CANNOT_CONNECT HTTP (host: 109.164.211.237)</Data>
      </EventData>
    Example 2
      <Provider Name="acvpnagent" />
      <EventID Qualifiers="9216">2</EventID>
      <Keywords>0x80000000000000</Keywords>
      <EventRecordID>97565</EventRecordID>
      <Channel>Cisco AnyConnect Secure Mobility Client</Channel>
    - <EventData>
      <Data>Function: CNetEnvironment::TestAccessToSG File: .\NetEnvironment.cpp Line: 1385 Invoked Function: CNetEnvironment::analyzeHttpResponse Return Code: -28966899 (0xFE46000D) Description: NETENVIRONMENT_ERROR_PROBE_INCOMPLETE:Network Probe could not contact target</Data>
      </EventData>

    HI and welcome to Discussions,
    in my personal opinion there is not much for you to worry about.
    The 'Windows Tool for the elimination of malware' is nothing you miss as long as you have a decent Anti-Virus Software running.
    The update for the IE 7 might be missing an installed IE 7, which can do by downloading it yourself from Microsofts webpage.
    If you don't use the IE but something like Firefox or Opera or Safari, than don't bother with these update.
    Stefan

  • Connection Timeout Expired in Windows Event Logs

    I just recently installed SharePoint 2013 SP1 on a Windows Server 2008 R2 SP1 server and have been receiving this error message in the Windows Event logs:
    Cannot connect to SQL Server.  <database server name> not found.  Additional error information from SQL Server is included below.
    Connection Timeout Expired.  The timeout period elapsed during the post-login phase.  The connection could have timed out while waiting for server to complete the login process and respond; Or it could have timed out while attempting to create
    multiple active connections.  The duration spent while attempting to connect to this server was - [Pre-Login] initialization=12; handshake=6; [Login] initialization=0; authentication=0; [Post-Login] complete=14000;
    I have never seen this error message before in my life on any prior installation of SharePoint that I have ever done.  It is only occurring on this one particular installation of SharePoint.  The environment is corporate built, so I have no idea
    as to how to troubleshoot or determine the root cause of this error message.
    I looked at the value of the database-connection-timeout in stsadm and it gets back a value of 15, however, I am unable to alter the database connection timeout using stsadm since I either get an "Object reference not sent to an instance of an object"
    error message or "This operation can be performed only on a computer that is joined to a server farm by users who have permissions in SQL Server to read from the configuration database.  To connect this server to the server farm, use the SharePoint
    Products Configuration Wizard, located on the Start menu in Microsoft SharePoint 2010 Products."
    Please advise. 

    What is specification of your SQL server? i think its more CPU, RAM, I/O issue with SQL server.
    under which account you are running the stsadm command?
    check this one
    http://stackoverflow.com/questions/21230927/sql-azure-the-timeout-period-elapsed-during-the-post-login-phase
    may be you fall in this bug
    http://connect.microsoft.com/VisualStudio/feedback/details/821803/connection-timeout-expired-the-timeout-period-elapsed-during-the-post-login-phase
    Please remember to mark your question as answered &Vote helpful,if this solves/helps your problem. ****************************************************************************************** Thanks -WS MCITP(SharePoint 2010, 2013) Blog: http://wscheema.com/blog

  • Lost connection windows event log

    I have found in the System Configuration a list of errors that I can have write to the windows event log, but it does not include the Lost Connection to agent/adapter error.  I am now looking at looking at taking that system "Event" and attaching an action to it to write to the windows event log.  Is this the best/most elegant way to go about it?  Is there a way to include the machine location (as opposed to the agent name) in the event?
    What I am attempting to do, and this is coming from a thread in the CPO section, is create a windows application event when a connection is lost.  CPO would then be monitoring the TES server windows event log for such an event and perform some diagnostic and attempt to recover the agent.
    Thanks for any help!

    That is also an option that we have talked about, using snmp traps.  Another option we've talked about it triggering a job which would then use the CPO web services to run a process.
    But I like the idea better to have CPO also monitoring the connections and doing something about it.  Using the Windows Event Log would allow us to do that.
    In any case, there is also still the problem of grabbing the machine location.

  • Cannot open eventlog service on computer '.'. (Windows Event Log service doesn't exist)

    This problem used to be solved after moving a computer object into the appropriate OU and restarting, and if that didn't work, it used to be solved when uninstalling and reinstalling Microsoft FEP (restarts in-between).  Now, the only way to access
    event logs is by logging in as a domain admin, or by accessing event logs through remote manage.
    If a machine object is added to the domain, dropped into the computers container, and restarted, we get this error when going into Computer Management:
    "Cannot open eventlog service on computer '.'."
    The original problem was noticed on our VMs, but I also tried it with a Lenovo Windows 7 build out of the box, added it to our domain, and the problem occurred. When our desktops are built, SCCM's task manager drops it into the appropriate OU immediately,
    so desktops don't have issues.  With VMs, they are dropped into the computers container and restarted, so once this problem occurs, it almost never leaves.  SOMETIMES, removing it from the domain solves the problem, but not always.
    I've tried all of the suggestions I've seen online and none of them have worked, such as cleaning up the policies (through registry, and the appropriate system folders), adding the proper NTFS permissions on the RtBackup folder and %SystemRoot%\System32\winevt\logs, netsh
    winsock reset, cleanboot, etc.
    I did notice that I'm unable to find the NT Service\EventLog user group. I wanted to add it to %systemroot%\system32\winevt\logs, but the group cannot be found on the local computer. Even if that's the problem, why is it missing?
    It doesn't seem like anyone else on the internet gets this exact error.

    Hi Kate!
    Yes, the Windows Event Log service is missing. I had already tried your method (#3), and I did try it again. This is the error I get:
    "The specified service already exists."
    If you check services.msc, it's still not there. If you try to start the Event Viewer, the same error comes up:
    Cannot open eventlog service on computer '.'.
    Hi, 
    Please check for the existence of this key. If not found, create a *.reg file from another machine and import.
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
    Then, check the issue again.
    If this doesn't work, let's run System file checker tool to repair system:
    Run SFC command in elevated command prompt
    SFC /scannow
    Any error message, please post here to let me know.
    Keep post.
    Kate Li
    TechNet Community Support

  • Thinking about using the Windows Event Logs as my main log store - looking for pros and cons

    I have been writing some larger scripts that write to physical log files.  Until today I have avoided trying to use the Windows Event logs, but, am beginning to rethink this and wondered if anyone has done this, and, what the strengths and weaknesses
    of this logging approach has been.  If I do it, I will probably write a function that accepts pipelined input and simply pass output to the log.  I wanted to get a feel for what I would be getting into before I started writing things up since this
    will probably take a little bit of work to get set up to run properly.

    At my company we use the Windows event log for many of our batch process logging for several reasons:
    Unlike logging to a central database, the Windows event log is always available. I've seen poorly thought out logging solution which log to a database and if the database happens to be unavailable the batch process would fail.
    Monitoring tool such as SCOM already have Windows event log watchers so adding alerts to take action based on message written to the Windows event log is easy
    Built-in support for writing Windows event log entries in the Powershell V2 write-eventlog cmdlet, a simple CLR can created in SQL Server or even command-line eventcreate.exe
    Easy to create a custom event log so you don't have to use the default application log in Windows 2008 and higher.
    Most shrink-wrap S/W already use the event log
    Issues I've seen:
    Windows 2008 with UAC on requires "registering" i.e. creating a new event log source with UAC. This can be done one time manually. Unfortunately there isn't a way to automate UAC--pure GUI. The Powershell command would be "New-EventLog -LogName Application
    -Source  mysource" if you're using the Application log and must be run as  administrator.
    Errant process writes many entries to the event log. Depending on the volume like for example writing stack dumps this can performance problems. I  think I recall an issue an Windows 2003 or Windows 2008 with UAC off  if you're creating a new
    event log source each time (which you shouldn't) then these results in many registry entries which can cause problems.
    I don't think the issues outweigh the benefits--just something to be aware of.

  • Read NT Event Log from Java

    Is there any way to read Windows NT Event Log from Java?
    Thanks
    Wilson Pu

    see http://www.javaworld.com/javaworld/jw-09-2001/jw-0928-ntmessages_p.html

  • While Installation of 11g database creation time error ORA-28056: Writing audit records to Windows Event Log failed Error

    Hi Friends,
    OS = Windows XP 3
    Database = Oracle 11g R2 32 bit
    Processor= intel p4 2.86 Ghz
    Ram = 2 gb
    Virtual memory = 4gb
    I was able to install the oracle 11g successfully, but during installation at the time of database creation I got the following error many times and I ignored it many times... but at 55% finally My installation was hanged nothing was happening after it..... 
    ORA-28056: Writing audit records to Windows Event Log failed Error  and at 55% my Installation got hung,,,, I end the installation and tried to create the database afterward by DBCA but same thing happened....
    Please some one help me out, as i need to install on the same machine .....
    Thanks and Regards

    AAP wrote:
    Thanks Now I am able to Create a database , but with one error,
    When I created a database using DBCA, at the last stage I got this error,
    Database Configuration Assistant : Warning
    Enterprise Manager Configuration Failed due to the Following error Listener is not up or database service is not registered with it.  Start the listener & Registered database service & run EM Configuration Assistant again....
    But when I checked the listener was up.....
    Now what was the problem,  I am able to connect and work through sqlplus,
    But  I didnt got the link of EM and when try to create a new connection in sql developer it is giving error ( Status : failure - Test Failed the Network Adapter could not establish the connection )
    Thanks & Regards
    Creation of the dbcontrol requires a connection via the listener.  When configuring the dbcontrol as part of database creation, it appears that the dbcontrol creation step runs before the dynamic registration of the databsase with the listener is complete.  Now that the database itself is completed and enough time (really, just a minute or two) has passed to allow the instance to register, use dbca or emca to create the dbcontrol.
    Are you able to get a sqlplus connection via the listener (sqlplus scott/tiger@orcl)?  That needs to be the first order of business.

  • I'm a beginner with iMovie and my hard drive is filling up fast. How do I move the event files from the hard drive to my time capsule?

    I'm a beginner with iMovie and my hard drive is filling up fast. How do I move the event files from the hard drive to my time capsule?

    you should never (ab)use a designated backup-setup for 'ordinairy' storage tasks.
    plus, the wireless connection to TC is too slow for iMovie.
    purchase any ext. usb-harddrive, 500Gigs starting at 50$ ...
    you HAVE to follow advice given here:
    http://help.apple.com/imovie/#mov3ac6d42c

  • How can I get more detailed logging in NFS Server (2012 R2)?

    I've set up the "Server for NFS" feature and have shared out a folder. I've made it as wide-open as possible. Anonymous access enabled, with read-write set up for a specific IP address. I attempt to connect to the mount using the following command
    on my Ubuntu 12.04 system:
    sudo mount -t nfs windowsmachine:/share /path/to/local/mount
    And I get an error of "Mount system call failed". I'm trying to figure out what the issue is but the Windows event logs have not been very helpful. I've set up activity logging via https://technet.microsoft.com/en-us/library/cc770981.aspx but still
    do not see much happening in the NFS or Windows security event logs. Can somebody tell me how I can troubleshoot this issue? Since I have anonymous access enabled and have not done any UID or GID weirdness, do I need to make the ntfs permissions everyone full
    control? Even if that were the case I'd expect to see some failures in the Windows security log.

    dpkg -la | grep nfs gives me
    ii  nfs-common     1:1.2.5-3ubuntu3.2                                 
    NFS support files common to client and server
    ii  nfs-kernel-server      1:1.2.5-3ubuntu3.2                                 
    support for NFS kernel server
    It's a relatively old version of Ubuntu, 12,04 LTS. I take it Ubuntu cares about what version the NFS server is running?

  • How to consume the Calendar Exception details from Project Server 2013 to an SSRS report using PSI ?

    Hello,
    Can anyone guide me how to access the calendar exception details from Project Server using PSI?
    I need to extract calendar details of enterprise resources , like exception name, exception type, exception start date and exception end date into my SSRS report hosted in SharePoint 2013 and 2010.
    I would be helpful if I can get a sample of this. I have read through many PSI documents in fact still going through ,what  PSI does and doesn't ,  PSI methods etc. from Project Server SDK and MSDN . Moreover, I
    am a beginner in .NET programming. I am confused and have lots of questions in my mind, like which PSI service should be used in my report(is it  just Calendar.svc), can we pull the details as XML type data source my SSRS report ,are
    there any other configuration settings apart from " setting up an event handler by installing an event handler assembly on each Project Server computer in the SharePoint farm, and then configuring the event handler
    for the Project Web App instance by using the Project Server Settings page in the General Application Settings of SharePoint Central Administration" (as per prerequisites for PSI in SDK) , how can I implement authentication settings
    -(when user with proper SharePoint permission
    can accesses the SSRS report  )
    Kindly bear with me if my questions are not appropriate .
    Please do guide me, and .
    Thanks in Advance!!
    Mridhula
    Mridhula.S

    Hi Brendan,
    Project server reporting database doesn't contain the calendar info. The only supported way to use the PSI to read the calendar info from Published database.
    See this
    reply from Amit.
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • How can open a html, pdf files from the server (c:\foldername\filename)

    Hi all,
    I am developing an application. in this app i have to implement RMI.
    My problem is this, How can a client open a files from the server.
    all the html, pdf files are stored in the server's directory like C:\audit\filename.
    There is a folder on the server's C directory which contains all the html , pdf files.
    please tell me how can a client open a file from the server using RMI.
    Please send me the solution as soon as possible.
    Thanks & Regards
    Bhavishya

    That's doing it the hard way. Why not use HTTP or FTP?

  • How can i get all the users from weblogic server?

    how can i get all the users from weblogic server?
    i have configurated a LDAP server using iPlanet and
    in weblogic server console i see those users from LDAP
    server. but how can i get all the users in my program
    from weblogic server instead of LDAP server?
    BTW,how to configure a RDBMSAuthenticator and what should i do
    in Oracle? which tables should i create? and how are their architectures?
    Thanks
    Daniel

    BTW, i use weblogic platform 8.1
    "Daniel" <[email protected]> дÈëÓʼþ
    news:[email protected]..
    how can i get all the users from weblogic server?
    i have configurated a LDAP server using iPlanet and
    in weblogic server console i see those users from LDAP
    server. but how can i get all the users in my program
    from weblogic server instead of LDAP server?
    BTW,how to configure a RDBMSAuthenticator and what should i do
    in Oracle? which tables should i create? and how are their architectures?
    Thanks
    Daniel

  • How to Get the excel sheet formula from the server side into the j2me app?

    How to Get the excel sheet formula from the server side into the j2me application?
    Here the excel sheet is in server side.i want to do get the excel sheet values (only some part of the excel sheet based on some conditions) from server side into j2me.In j2me I want to done some client side validation based on the formula of excel sheet.Then i resend the new updated data to the server.
    But here deosn't know any mehtod to get the excel sheet formula from server side.So kindly help me to get the excel sheet formula from the server.
    So how to get the excel sheet formula frome the server side into j2me Application...
    Plz guide me to solve this issue...
    thanks & regards, Sivakumar.J

    You should not post a thread more than once. You've crossposted this question to another forum. I have deleted that one.

Maybe you are looking for

  • How can I deactivate a product from a computer that is dead?

    Hello, I am trying to install my Design Suite Premium onto a new computer.  The only problem is that the 2 computers I installed it on are dead.  I cannot even turn them on - one is a hard drive problem, the other was a 12 year old computer that will

  • How to create business partner

    Hi All, I am working on a requirement where I need to create Business partners for employees that have a role as an AP vendor as this will allow personal data (address/bank info) to be shared across applications. So can you please tell me how can I d

  • Apple LCD Keeps flickering a balck screen while coneected to my Powerbook

    I have attached my apple 24inch LCD screen to my Mac Powerbook and the LCD keeps flickering a balck screen in intervals. Can any one help?

  • GR non valuated help

    hello to all, Good day. I have an issue with GR non valuated being ticked in a PO.  I have one user request to have this field unticked.  But based on checks done, seems that the PO has already been GR/IR.  Can you still proceed with unticking the ch

  • I need to run the program in back ground and then update two fields

    hi gurus i need to run the program in back ground and then update two fields in the z table by mm02 transaction by using bapis , can any one give me the code for this. Message was edited by:         Rocky