How to put log file into iphone (swift4)

I making application. I have some question. When user first access, they can see loading Page. and than after access, skip to loading page .

so i will make user table using mysql. If user first access, insert into user table. so if user download my application, how to put log file ?

  1. User first run my app.
  2. When run app again, skip loading page.
  3. I don't know user how many run my app. so if user first run my app, install log file(.txt and so on)
  4. than i can check user log file. and than i can insert myDB