Q:

calling void sync method from Async - Cannot await void

I am implementing ExceptionLogger for WebApi, where exceptions are logged into database.
 public class CustomExceptionLogger : ExceptionLogger
{
    public override async Task LogAsync(ExceptionLoggerContext context, CancellationToken cancellationToken)
    {
       var log = new Logger();
       await log.LogMessage(context.Exception); --Cannot await 'void' complie time error here
    }
}

public class Logger
{
   public void LogMessage(Exception ex)
   {
     //code to insert message into db
   }
}

How to fix this?

A:

If you truly want LogMessage() to be async and awaitable, you will need to change your code to look something like this:
public class Logger
{
   public async Task LogMessage(Exception ex)
   {
     //code to insert message into db
   }
}

For it to be of any use, your database insert code should also be async.

