Yes, you could use the FallbackGroup target for that. In the fallback group you should configure the database and file target.
e.g.
<target xsi:type="FallbackGroup" name="all" returnToFirstOnSuccess="true"><target name="target1" xsi:type="Database" ... /><target name="target2" xsi:type="File" ... /></target><rules><logger name="*" minlevel="Trace" writeTo="all" /></rules>