FTP Log File Name with macro RRS feed

  • Question

  • Hi,

    How can I set the log file in the ftp adapter to something like this D:\Logs\ftp_%date%.log ?

    I would like this so that the log will not just grow until very large and I can have another job to cleanup old logs based on the timestamp and keep up to 1 week of logs only.

    Thursday, May 31, 2012 11:59 AM


All replies

  • I dont think ftp logfiles support macros


    Friday, June 1, 2012 11:10 AM
  • Hi,

    the settings for the ftp Adapter configuration are located in the CustomProps/AdapterConfig-node of the binding file:

       <TransportTypeData>&lt;CustomProps&gt;&lt;AdapterConfig vt="8"&gt;&amp;lt;Config xmlns:xsi="" xmlns:xsd=""&amp;gt;&amp;lt;uri&amp;gt;ftp://ftpsvr:21/%MessageID%.xml&amp;lt;/uri&amp;gt;&amp;lt;serverAddress&amp;gt;ftpsvr&amp;lt;/serverAddress&amp;gt;&amp;lt;serverPort&amp;gt;21&amp;lt;/serverPort&amp;gt;&amp;lt;userName&amp;gt;ftpUser&amp;lt;/userName&amp;gt;&amp;lt;password&amp;gt;******&amp;lt;/password&amp;gt;&amp;lt;accountName /&amp;gt;&amp;lt;targetFileName&amp;gt;%MessageID%.xml&amp;lt;/targetFileName&amp;gt;&amp;lt;commandLogFilename&amp;gt;C:\inetpub\logs\LogFiles\FTPSVC2\%time%.log&amp;lt;/commandLogFilename&amp;gt;&amp;lt;representationType&amp;gt;binary&amp;lt;/representationType&amp;gt;&amp;lt;allocateStorage&amp;gt;False&amp;lt;/allocateStorage&amp;gt;&amp;lt;connectionLimit&amp;gt;0&amp;lt;/connectionLimit&amp;gt;&amp;lt;passiveMode&amp;gt;False&amp;lt;/passiveMode&amp;gt;&amp;lt;firewallType&amp;gt;NoFirewall&amp;lt;/firewallType&amp;gt;&amp;lt;firewallPort&amp;gt;21&amp;lt;/firewallPort&amp;gt;&amp;lt;firewallPassword&amp;gt;******&amp;lt;/firewallPassword&amp;gt;&amp;lt;useSsl&amp;gt;False&amp;lt;/useSsl&amp;gt;&amp;lt;useDataProtection&amp;gt;True&amp;lt;/useDataProtection&amp;gt;&amp;lt;ftpsConnMode&amp;gt;Explicit&amp;lt;/ftpsConnMode&amp;gt;&amp;lt;/Config&amp;gt;&lt;/AdapterConfig&gt;&lt;/CustomProps&gt;</TransportTypeData>

    In this sample i provided a macro style setting for the ftp log file, e.g. %time%. However, this value for the ftp log in the ftp adapter configuration will create a log file with the same physical file name. The macro substitution in this case will not taken place.

    You can read more about using marcos in BizTalk Server, here: BizTalk – List of Macros, by Sandro Pereira

    As ftp log files are structured by columns, it would be possible to write a daily batch job, which parses the log file and strips out the data you need. Another approach would be to setup a SSIS job in SQL Server, which processes the log data.


    Paul Endras
    Endras IT Consulting  

    If this answers your question and is a helpful post, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.


    Monday, June 4, 2012 7:57 AM