IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Creating a schedule job to compress and archive webMethods log files automatically

  • 1.  Creating a schedule job to compress and archive webMethods log files automatically

    Posted Mon March 19, 2012 07:07 AM

    Dear members,
    Hope everyone is doing great.
    Can someone help me How we can creat a schedule job to compress and archive webMethods log files automatically.

    Its urgent , pls help me.

    regards,
    Hari


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: Creating a schedule job to compress and archive webMethods log files automatically

    Posted Mon March 19, 2012 08:51 AM

    Archive of webMethods log files inside IS/logs folder will happen by default. You would have seen the older files appended with date. For compression of the same, you have to write some custom service and schedule it to run everyday once.

    -Senthil


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 3.  RE: Creating a schedule job to compress and archive webMethods log files automatically

    Posted Mon March 19, 2012 08:57 AM

    Hi Senthil,

    Thanks for your reply, Since I dont much experience in webMethods, Could you pls help me the procedure(steps) how we can write the code.

    regards,
    Hari


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 4.  RE: Creating a schedule job to compress and archive webMethods log files automatically

    Posted Mon March 19, 2012 09:16 AM

    You can write a java service to do the same… Here is a sample…

    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    String fileName = IDataUtil.getString( pipelineCursor, “fileName” );
    String fileDir = IDataUtil.getString( pipelineCursor, “fileDir” );
    String inputString = IDataUtil.getString( pipelineCursor, “inputString” );
    String zipFileName = IDataUtil.getString( pipelineCursor, “zipFileName” );
    String zipFileDir = IDataUtil.getString( pipelineCursor, “zipFileDir” );
    pipelineCursor.destroy();

    // pipeline
    zipFileName = zipFileDir+zipFileName;
    byte buf = new byte[1024];
    try {
    ZipOutputStream out = new ZipOutputStream(new FileOutputStream(zipFileName));
    // Compress the files
    FileInputStream in = new FileInputStream(fileDir+fileName);
    out.putNextEntry(new ZipEntry(fileName));

            // Transfer bytes from the file to the ZIP file
    out.write(inputString.getBytes());
    // Complete the entry
    out.closeEntry();
    in.close();
    // Complete the ZIP file
    out.close();
    } catch (IOException e) {
    
    }
    

    HTH
    Senthil


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 5.  RE: Creating a schedule job to compress and archive webMethods log files automatically

    Posted Tue March 20, 2012 12:42 PM