fcClient: Notifications when license limits are near (Article # 252)
View products that this article applies to.
Problem:
The fcSDK is responsible for tracking and enforcing licensing.
There is typically a license limit, then a small number of grace licenses that can be used.
For example, you may have 50 licenses and 3 grace licenses.
Applications that use the fcSDK (such as fcClient and fcSelfService) can be configured to notify an administrator when the licensing has started to use grace licenses, and when the total limit has been reached.
Resolution:
Using the log4net logging infrastructure supported by the fcSDK, we can configure log4net to email an administrator in these instances.
The following logging configuration illustrates how to do this.
<log4net>
<appender name="SmtpAppender" type="log4net.Appender.SmtpAppender">
<to value="admin@company.com" />
<from value="admin@company.com" />
<subject value="Message from fcClient :: You have hit your license limit" />
<smtpHost value="MyMailServer" />
<bufferSize value="1" />
<lossy value="false" />
<filter type="log4net.Filter.StringMatchFilter">
<param name="StringToMatch" value="Grace license reserved for productId"/>
</filter>
<filter type="log4net.Filter.StringMatchFilter">
<param name="StringToMatch" value="Could not obtain license"/>
</filter>
<filter type="log4net.Filter.DenyAllFilter" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="You have hit your license limit.%newlineDate: %date%newlineServer: %property{log4net:HostName}%newlineError:%message%newline" />
</layout>
</appender>
<root>
<level value="debug" />
<appender-ref ref="SmtpAppender" />
</root>
</log4net>
More information on log4net is here: http://logging.apache.org/log4net/
More information on fcSDK configuration is in the fcSDK documentation: http://www.dovetailsoftware.com/resources/docs.aspx?product=fcSDK
Applies To: