Locale, time zone, and currency settingsAnother thing that brought a surprise was the container’s regional settings.
The application’s
Web.config already had globalization fixed to
fr-FR. But, as it turned out, that alone was not enough. For the reports and the application as a whole to work correctly, the container also had to explicitly configure culture, system locale, language list, time zone, and currency formats.
Our application generates documents and works with dates, amounts, currencies, and string representations of numbers. And if the container runs, for example, with default settings, we again get problems in the reports, even if everything is fine with fonts:
- dates are displayed in the wrong format;
- monetary values use the wrong separator;
- the currency symbol differs from what is expected;
- the time zone is not the expected one.
That is why the container explicitly sets
fr-FR, the
Romance Standard Time time zone, and currency parameters through
HKEY_USERS\.DEFAULT\Control Panel\International.
There is one more nuance here. Since the application runs in IIS, loading the user profile is disabled for the application pool, and the required regional settings are configured for the default profile.
Permissions and persistent storageNext come the less Crystal-specific issues related to using disk space for application logs.
The Dockerfile separately creates the
C:\home\LogFiles\Application directory and grants permissions to
IIS_IUSRS and
IUSR both for the application directory and for the log directory.
Here it is especially important to remember that in App Service, the C:\home path inside the container is mapped to the App Service file system. In other words, the data written there will be available in the App Service file system and, first, will not disappear when the container is redeployed, and second, will be available for viewing through developer tools.
Logging specificsNow, separately about logs.
In the project, logging is configured in
Web.config through
log4net. We configured two logging outputs.
- The first is RollingFileAppender, which writes to C:\home\LogFiles\Application\app.log.
- The second is ConsoleAppender, which writes to the container’s standard output.
As a result, logs can be viewed both in the standard App Service application log output and as files in the service’s file system.
The file appender is useful because it provides a proper rolling log. In our configuration, the log is appended to the existing file, rotated by size, limited to 10 MB per file, and keeps up to 10 archives. In addition,
MinimalLock is used, which reduces the risk of file locking issues during writes.