14 Replies Latest reply: May 15, 2013 8:41 AM by LJ LongWing RSS

    Enable and Disable logs

    Sanjeeva Gurram

      Hi Experts,

       

      we are planning to implement like the below way, if there any method or scripts to do, what is thebetter way to acive it

       

      1. Scheduled job to enable logs (e.g. filter log) and wait for 10 minutes
      2. After 10 minutes, disable the log(s) and cut and paste the log(s) at some pre-defined place
      3. Enable the logs again after movement of the file
      4. Repeat the same process from  1 through 3 continuously

      Thanks

      Sanjeeva Naidu G

        • 1. Re: Enable and Disable logs
          Dhananjay Gundre

          Why not to use feature of adding logs to forms and writing workflow to remove not required logs. You can use Configuration-ARDBC form to enable and disable logs.

          • 2. Re: Enable and Disable logs
            Sanjeeva Gurram

            Dhanajay,

             

            U have any setps to do that, If yes plz share the setps or any document if u have

             

            Thanks

            Sanjeeva Naidu G

            • 3. Re: Enable and Disable logs
              Laurent Matheo

              You could also use APIs (java for example).

              It should be API class LoggingInfo.

              Unzip file "ardoc7604_build002.jar" (should be in folder "/ARSystem/arserver/api/" it contains API help files.

              • 4. Re: Enable and Disable logs
                Leonard Warren

                Using the Configuration-ARDBC form to activate and deactivate log files will require you to reboot the AR System Server at some point because the changes will take place but the Developer Studio will pick up a change was made and let you know it when you log into the Studio until the reboot has taken place.  It is an option but you need to understand the results of your actions as well.

                 

                The utilization of Form logging is a possibility but it is a huge database resource hit.  The information is being stored within your underlying database instead of your server box.  Leaving the log files on continuous could cause a slowness in your system for other operations.  But it is an option.

                 

                The APIs is a possibility, but I have not done this set up at this time.

                 

                Not sure what is the best way to approach this request.  There is always a way to actions or reactions within Remedy, but for this situation, I am not sure what is the best way at this time.

                 

                Lenny

                • 5. Re: Enable and Disable logs
                  Laurent Matheo

                  My bad, the API I saw (setlogging) is for client side logs though perhaps it's possible with "SetServerInfo".

                  • 6. Re: Enable and Disable logs
                    Laurent Matheo

                    Yeah it's working with SetServerInfo ^_^ here is a snipset from java code:

                    import com.bmc.arsys.api.ARException;

                    import com.bmc.arsys.api.ARServerUser;

                    import com.bmc.arsys.api.ServerInfoMap;

                    import com.bmc.arsys.api.Value;

                     

                    private ARServerUser ID_server=null;

                    //put here some code to init server connection using ID_Server, check integration guide for a full example.

                     

                    ServerInfoMap MyMap = new ServerInfoMap();

                                        Value MyValue =new Value(1); //Triggers SQL log

                                        Value MyValuePath =new Value("c:\\tmp\\logs_sql.log"); //SQL log path

                                        MyMap.clear();

                                        MyMap.put(AR_SERVER_INFO_DEBUG_MODE, MyValue);          //1=2^0=SQL

                                        MyMap.put(AR_SERVER_INFO_SQL_LOG_FILE, MyValuePath);          //SQL file path

                     

                                        try {

                                                  ID_server.setServerInfo(MyMap);

                                                  System.out.println("Set log ok!");

                                        } catch (ARException e) {

                                                  System.out.println("Exception Error in set_all_intel!");

                                                  return false;

                                        }

                     

                    You have to do the same process but set the DEBUG_MODE to 0 to deactivate the logging.

                    • 7. Re: Enable and Disable logs
                      Sanjeeva Gurram

                      Lenny,

                       

                      U have any steps for this or   if u have any document can u share with  me it will be helpful for me

                       

                      Thanks

                      Sanjeeva Naidu G

                      • 8. Re: Enable and Disable logs
                        Sriram GP

                        hi  Laurent Matheo,

                           i am trying to use the same java code, sql logs got enabled but, all other options got unchecked, how to check/uncheck sql log, without affecting other options?

                         

                        Sriram

                        • 9. Re: Enable and Disable logs
                          LJ LongWing

                          The Debug Mode is a bitwise value, you would need to parse the value to determine if a given log is on or not, and then add the appropriate bit mask to the value, or subtract appropriate ammount to turn on/off.

                          • 10. Re: Enable and Disable logs
                            Sriram GP

                            Thank you for the information.

                            Sriram

                            • 11. Re: Enable and Disable logs
                              Abhijit NameToUpdate

                              Guyz,

                               

                              We have 9 applications on same server, so taking server down is like taking all the applications down. We dont want that, we need a switch to take down just one application. Let me know if we have any such ready option in remedy.

                               

                              Thanks,

                              Abhijit

                              • 12. Re: Enable and Disable logs
                                LJ LongWing

                                You could chang the application state of just that application to maintenance and users should not be able to access it, but that is only if the app is in a deployable application

                                • 13. Re: Enable and Disable logs
                                  Abhijit NameToUpdate

                                  where I will get that option?

                                  • 14. Re: Enable and Disable logs
                                    LJ LongWing

                                    Abhijit,

                                    This is found in the form 'AR System Application State' form, but I honestly recommend you read up on the option before making any changes...