You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by da...@apache.org on 2004/04/29 08:52:01 UTC

cvs commit: ws-axis/c/include/axis/server AxisConfig.h AxisTrace.h

damitha     2004/04/28 23:52:01

  Modified:    c/src/common AxisConfig.cpp AxisTrace.cpp
               c/include/axis/server AxisConfig.h AxisTrace.h
  Log:
  after this change client side log is written to $AXIS_HOME/logs/AxisClientLog
  
  Revision  Changes    Path
  1.19      +15 -0     ws-axis/c/src/common/AxisConfig.cpp
  
  Index: AxisConfig.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisConfig.cpp,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- AxisConfig.cpp	28 Apr 2004 05:55:38 -0000	1.18
  +++ AxisConfig.cpp	29 Apr 2004 06:52:01 -0000	1.19
  @@ -30,6 +30,7 @@
   {
       m_sWsddFilePath = 0;
       m_sAxisLogPath = 0;
  +    m_sAxisClientLogPath = 0;
       m_sClientWsddFilePath = 0;
       m_sAxisHome = 0;
       m_sValue = NULL;
  @@ -41,6 +42,8 @@
           free(m_sWsddFilePath);
       if (m_sAxisLogPath)
           free(m_sAxisLogPath);
  +    if (m_sAxisClientLogPath)
  +        free(m_sAxisClientLogPath);
       if (m_sClientWsddFilePath)
           free(m_sClientWsddFilePath);
       if (m_sAxisHome)
  @@ -93,6 +96,12 @@
               strncpy (m_sAxisLogPath, m_sValue + 1, linesize - strlen (key) - 2);
               m_sAxisLogPath[linesize - strlen (key) - 2] = '\0';
           }
  +        if (strcmp (key, "AXISCLIENTLOGPATH") == 0)
  +        {
  +            m_sAxisClientLogPath = (char*) malloc (CONFBUFFSIZE);
  +            strncpy (m_sAxisClientLogPath, m_sValue + 1, linesize - strlen (key) - 2);
  +            m_sAxisClientLogPath[linesize - strlen (key) - 2] = '\0';
  +        }
           if (strcmp (key, "CLIENTWSDDFILEPATH") == 0)
           {
               m_sClientWsddFilePath = (char*) malloc (CONFBUFFSIZE);
  @@ -116,6 +125,10 @@
       return m_sAxisLogPath;
   }
   
  +char* AxisConfig::getAxisClientLogPath ()
  +{
  +    return m_sAxisClientLogPath;
  +}
   
   char* AxisConfig::getClientWsddFilePath ()
   {
  @@ -134,6 +147,8 @@
       char* pWsddPath = objConfig->GetWsddFilePath();
       printf("pWsddPath:%s\n", pWsddPath);
       char* LogPath = objConfig->GetAxisLogPath();
  +    //to build
  +    //gcc AxisConfig.cpp -o temp -I$AXISCPP_HOME/include -L$AXISCPP_HOME/bin -lserver_engine -ldl
   
   }
   */
  
  
  
  1.18      +25 -16    ws-axis/c/src/common/AxisTrace.cpp
  
  Index: AxisTrace.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/common/AxisTrace.cpp,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- AxisTrace.cpp	27 Apr 2004 05:39:20 -0000	1.17
  +++ AxisTrace.cpp	29 Apr 2004 06:52:01 -0000	1.18
  @@ -47,34 +47,43 @@
       if ((fileTrace = fopen (sFileName, "a")) == NULL)
           return AXIS_FAIL;
       fclose (fileTrace);
  -    int length = strlen (sFileName) + 12;
  -    char* setPerm = (char *) malloc (length);
  -    if (setPerm)
  -    {
  -        strcpy (setPerm, "chmod 766 ");
  -        strcat (setPerm, sFileName);
  -    }
  -
  -#ifdef __GNUC__
  -    system (setPerm);
  -#endif
  +    setFilePerm(sFileName);
       if ((fileTrace = fopen (sFileName, "a")) == NULL)
           return AXIS_FAIL;
  -
  -    free(setPerm);
  +                                                                                                                             
       return AXIS_SUCCESS;
   }
   
   int AxisTrace::openFileByClient ()
   {
  -    char* sFileName = "./ClientAxisLog";
  -
  +    char* sFileName = g_pConfig->getAxisClientLogPath ();
       if ((fileTrace = fopen (sFileName, "a")) == NULL)
           return AXIS_FAIL;
  -
  +    fclose (fileTrace);
  +    setFilePerm(sFileName);
  +                                                                                                                             
  +    if ((fileTrace = fopen (sFileName, "a")) == NULL)
  +        return AXIS_FAIL;
  +                                                                                                                             
       return AXIS_SUCCESS;
   }
   
  +int AxisTrace::setFilePerm(const char* sFileName)
  +{
  +    int length = strlen (sFileName) + 12;
  +    char* setPerm = (char *) malloc (length);
  +    if (setPerm)
  +    {
  +        strcpy (setPerm, "chmod 766 ");
  +        strcat (setPerm, sFileName);
  +    }
  +                                                                                                                             
  +#ifdef __GNUC__
  +    system (setPerm);
  +#endif
  +                                                                                                                             
  +    free(setPerm);
  +}
   
   int AxisTrace::logthis (const char* sLog, int level, char* arg2, int arg3)
   {
  
  
  
  1.6       +22 -15    ws-axis/c/include/axis/server/AxisConfig.h
  
  Index: AxisConfig.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/AxisConfig.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AxisConfig.h	26 Apr 2004 04:05:13 -0000	1.5
  +++ AxisConfig.h	29 Apr 2004 06:52:01 -0000	1.6
  @@ -38,31 +38,37 @@
           AxisConfig();
           ~AxisConfig();
           /**
  -	     * This is called to get the server.wsdd file path.
  +	 * This is called to get the server.wsdd file path.
            * 
  -	     * @return the server.wsdd file path 
  -	     */
  +	 * @return the server.wsdd file path 
  +	 */
           char* getWsddFilePath();
           /**
  -	     * This is called to get the AxisLog file path.
  +	 * This is called to get the AxisLog file path.
            *
  -	     * @return the AxisLog file path.
  -	     */
  +	 * @return the AxisLog file path.
  +	 */
           char* getAxisLogPath();
  +        /**
  +         * This is called to get the AxisClientLog file path.
  +         *
  +         * @return the AxisClientLog file path.
  +         */
  +        char* AxisConfig::getAxisClientLogPath ();
   		
  -		/**
  -	     * This is called to get the client.wsdd file path.
  +	/**
  +	 * This is called to get the client.wsdd file path.
            * 
  -	     * @return the client.wsdd file path 
  -	     */
  +	 * @return the client.wsdd file path 
  +	 */
           char* getClientWsddFilePath();
   
           /**
  -	     * This method will read from the configuration file called axiscpp.conf
  +	 * This method will read from the configuration file called axiscpp.conf
            * which is located in a place defined by AXIS_HOME environment variable. 
   	 
  -	     * @return The status which indicates whether the operation is success (AXIS_SUCCESS) or not (AXIS_FAIL).
  -	     */
  +	 * @return The status which indicates whether the operation is success (AXIS_SUCCESS) or not (AXIS_FAIL).
  +	 */
           int readConfFile();
   
   		char* getAxisHomePath();
  @@ -72,10 +78,11 @@
           //char m_AxisLogPath[CONFBUFFSIZE];
           //char m_sWsddFilePath[CONFBUFFSIZE];
           //char m_sAxisLogPath[CONFBUFFSIZE];
  -		char* m_sAxisHome;
  +        char* m_sAxisHome;
           char* m_sWsddFilePath;
           char* m_sAxisLogPath;
  -		char* m_sClientWsddFilePath;
  +        char* m_sAxisClientLogPath;
  +        char* m_sClientWsddFilePath;
           char* m_sValue;
           char m_sLine[CONFBUFFSIZE];
   };
  
  
  
  1.9       +4 -2      ws-axis/c/include/axis/server/AxisTrace.h
  
  Index: AxisTrace.h
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/include/axis/server/AxisTrace.h,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- AxisTrace.h	27 Apr 2004 03:50:34 -0000	1.8
  +++ AxisTrace.h	29 Apr 2004 06:52:01 -0000	1.9
  @@ -93,8 +93,7 @@
   {
   public:
       AxisTrace();
  -	virtual ~AxisTrace();
  -    int logthis(const char* sLog, int level, char* arg2, int arg3);
  +    virtual ~AxisTrace();
       /**
   	 * This is called in writing to the log file whose path is specified in $AXIS_HOME/axiscpp.conf file.
        * This method is used when the caller has only one string message as argument. User
  @@ -176,6 +175,9 @@
       char* strLevel;
       FILE* fileTrace;
       FILE* ConfFile;
  +
  +    int setFilePerm(const char* sFileName);
  +    int logthis(const char* sLog, int level, char* arg2, int arg3);
   
   };