FTP Log File Name with macro
-
Thursday, May 31, 2012 11:59 AM
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.
All Replies
-
Friday, June 01, 2012 11:10 AM
I dont think ftp logfiles support macrosKiranMP
- Marked As Answer by Rohit.SharmaMVP, Moderator Monday, June 04, 2012 6:50 AM
-
Monday, June 04, 2012 7:57 AM
Hi,
the settings for the ftp Adapter configuration are located in the CustomProps/AdapterConfig-node of the binding file:
<TransportTypeData><CustomProps><AdapterConfig vt="8">&lt;Config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt;&lt;uri&gt;ftp://ftpsvr:21/%MessageID%.xml&lt;/uri&gt;&lt;serverAddress&gt;ftpsvr&lt;/serverAddress&gt;&lt;serverPort&gt;21&lt;/serverPort&gt;&lt;userName&gt;ftpUser&lt;/userName&gt;&lt;password&gt;******&lt;/password&gt;&lt;accountName /&gt;&lt;targetFileName&gt;%MessageID%.xml&lt;/targetFileName&gt;&lt;commandLogFilename&gt;C:\inetpub\logs\LogFiles\FTPSVC2\%time%.log&lt;/commandLogFilename&gt;&lt;representationType&gt;binary&lt;/representationType&gt;&lt;allocateStorage&gt;False&lt;/allocateStorage&gt;&lt;connectionLimit&gt;0&lt;/connectionLimit&gt;&lt;passiveMode&gt;False&lt;/passiveMode&gt;&lt;firewallType&gt;NoFirewall&lt;/firewallType&gt;&lt;firewallPort&gt;21&lt;/firewallPort&gt;&lt;firewallPassword&gt;******&lt;/firewallPassword&gt;&lt;useSsl&gt;False&lt;/useSsl&gt;&lt;useDataProtection&gt;True&lt;/useDataProtection&gt;&lt;ftpsConnMode&gt;Explicit&lt;/ftpsConnMode&gt;&lt;/Config&gt;</AdapterConfig></CustomProps></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.
hth
Paul Endras
Endras IT Consulting | www.endras.deIf this answers your question and is a helpful post, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.

