Webmasters, gagnez de l'argent en affichant des bannières contextuelles Oxado
SourceForge.net Logo
Support This Project
   LeCouteauSuisse Project
Welcome ! [ Home ]  ·  [ Downloads ]  ·  [ Forums ]  ·  [ News ]  ·  [ Documentations ]  
[ Home ]

[ Documentations ]

FileReceiver


This receiver write into a file on each event.

See Service Configuration for detailled information to configure your service. You must declare this receiver with the <receiver> section inside a <group> section. It will looks like :

<receiver name="MyReceiverName" type="LeCouteauSuisse.Components.FileReceiver, 
		LeCouteauSuisseComponents, Version=1.0.0.2, Culture=neutral, PublicKeyToken=8d1037c5df6d5bd0">
This component have some parameters inside the section <settings>. Each parameter is written with a <setting> section.

Key nameMandatoryDefault valueDescription
filenameFormatYes The full path and name of the file
filenameArgumentsNo The arguments to format filenameFormat. See Format parameters.
appendFileNotrueDetermines whether data is to be appended to the file. If the file exists and append is false, the file is overwritten. If the file exists and appendFile is true, the data is appended to the file. Otherwise, a new file is created.
forceOpenCloseOnEventNofalseDetermines whether the file is open and close on each event. If forceOpenCloseOnEvent is true, the receiver open the file, write data and close the file. If forceOpenCloseOnEvent is false, the receiver open at the first access the file and close it when the service is stopping or when the name of the file change.
headerFormatNo Header to write at the beginning of the file.
headerArgumentsNo The arguments to format headerFormat. See Format parameters.
footerFormatNo Footer to write at the end of the file.
footerArgumentsNo The arguments to format footerFormat. See Format parameters.
lineFormatNo The line to write for each event.
lineArgumentsNo The arguments to format lineFormat. See Format parameters.

Sample of configuration :

<settings>
	<setting key="filenameFormat" value="c:\Temp\FileReceiver_{1}_{0:yyyyMMdd}.csv"/>
	<setting key="filenameArguments" value="ReceiverContext.Name"/>
	<setting key="lineFormat" value="{0:yyyyMMdd-HHmmss},{1},{2},{3}"/>
	<setting key="lineArguments" value="Id,Generated,Data"/>
	<setting key="headerFormat" value="Date,Event Id,Date generated,Data"/>
	<setting key="headerArguments" value=""/>
	<setting key="footerFormat" value=""/>
	<setting key="footerArguments" value=""/>
	<setting key="appendFile" value="true"/>
	<setting key="forceOpenCloseOnEvent" value="false"/>
</settings>

This receiver will create a CSV file with a header "Date,Event Id,Date generated,Data" and write events inside. It create a file each day named like FileReceiver_MyReceiverName_20090623.csv.


LeCouteauSuisse