Regardless of using Scala or Java, the answer is easy for x == 1 and x == 7.
For daily rollover, use
<fileNamePattern>logfile.%d{yyyy-MM-dd}.log</fileNamePattern>
and for weekly, write
<fileNamePattern>logfile.%d{yyyy-ww}.log</fileNamePattern>
(actually it rolls over at the start of the week depending on your locale, and not every seven days).
If you want a more general solution, you have to implement your custom RollingPolicy, but I don't know why would you need that. If you have problems with this size of the log, you should note that the log can be rolled over when a a specific size is reached. There are plenty of examples at http://logback.qos.ch/manual/appenders.html