Configure a log for an import instance
It is possible to configure all logging for an import configuration to be routed to a specific log. Here is how:
Make a note of the name of the import configuration you wish to log separately. The name is defined by the filename minus extension so in this example we are going to make a log configuration for AssetUploadNoMetadataNoReplace.
Now open the .config for your Import service which is normally named ImportService.exe.config. Scroll down to the section called log4net.
Insert an element after the <root> element like this:
Set the name and also put in the name in the ref tag of appender-ref so you end with the name + Appender. The additivity="false" tag is quite important as without it root settings will be inherited.
Now scroll down past the <appender> tags to create a new appender like this:
This configuration can be anything supported by log4net. The example config logs by rolling date, then size with a filename pattern like importer-yyyy-mm-dd.log. Please see log4net documentation for further information. The version in use is 2.0.8.
Override ComboSeparator and/or ComboMatchStyle for specific metafields
Make sure you know how ComboMatchStyle is set. If it is not explicitly set it defaults to the textvalue. ComboSeparator defaults to ; (semicolon). Even though the configs are called combo... they are in effect also for tree type metafields.
Excel metadata - an example
Lets say an import configuration holds the default configuration:
<ComboSeparator>;</ComboSeparator>
<ComboMatchStyle>TextValue</ComboMatchStyle>
Normally in the spreadsheet only the metafield ID is set - no other configuration is read from here. Let's say we need to update a MultiComboValue with ID 50521. That might look like this:
Now the metafield row accepts a simple notation like this: Metafield-ID ComboSeparator ComboMatchStyle.
In this example we tell the importer this is Metafield 50521, the combo separator is , (comma) and we want to match against the optionvalue.
It's important that there is a space in between the values. It's not necessary to specify ComboMatchStyle if the default is preferred but it is necessary to set ComboSeparator if in need of setting ComboMatchStyle. So:
- "50521 ," is equivalent to "50521 , TextValue" when TextValue is the default ComboMatchStyle.
- "50521 OptionValue" or "50521 TextValue" are not valid.