title: Record user login for audit on IdentityServer4
body: <p>I have a server running for Identity only for authentication and I want to log every user login.
  I've read the Identity doc and tried using the <a href="http://docs.identityserver.io/en/latest/topics/events.html" rel="nofollow noreferrer"><code>IEventSink</code></a>. It's supposed to be easy, but Login keeps working without calling the EventSink. 
  Do I have to register my class somewhere? What am I missing?</p>
  
  <pre><code>var builder = services
  .AddIdentityServer(options =&gt;
  {
      options.Events.RaiseSuccessEvents = true;
  }
  )
  .AddInMemoryIdentityResources(Config.GetIdentityResources())
  .AddInMemoryApiResources(Config.GetApis())
  .AddInMemoryClients(Config.GetClients())
  .AddAspNetIdentity&lt;ApplicationUser&gt;()
  .AddOperationalStore(options =&gt;
  {
      options.ConfigureDbContext = b =&gt;
          b.UseMySql(Configuration.GetConnectionString("DefaultConnection")
      );
      options.EnableTokenCleanup = true;
  });
  </code></pre>
  
  <p>This is the EventSink I created:</p>
  
  <pre><code>public class MyEventSink : IEventSink
  {
      public Task PersistAsync(Event evt)
      {
          if (evt.Id.Equals(EventIds.TokenIssuedSuccess))
          {
              var _test = evt as TokenIssuedSuccessEvent;
          }
          throw new System.NotImplementedException(); // shouldn't even login
          return Task.CompletedTask;
      }
  }
  </code></pre>