GithubHelp home page GithubHelp logo

Comments (8)

siddhant123-geek avatar siddhant123-geek commented on September 24, 2024

@pmwmedia Please help me with it.

from tinylog.

pmwmedia avatar pmwmedia commented on September 24, 2024

Can you create a minimal reproduction project? Just fork tinylog-android-example, add your tinylog.properties, and add your storage permissions to the forked project. If we are able to reproduce your issue by using the official Android example project, we can probably find the root cause for your issue.

from tinylog.

siddhant123-geek avatar siddhant123-geek commented on September 24, 2024

@pmwmedia Current Status -
After some more adding some media permissions I am able to write to the file when using write: file
But still when I try to use writer: Rolling File, and to check if the previous files are stores in the arhives I keep a miniml size in the policy. You can find my tinylog.properties file over here -
writer = rolling file
writer.directory = /storage/emulated/0/Android/data/com.palisisag.pitapp/files
writer.file = /storage/emulated/0/Android/data/com.palisisag.pitapp/files/myLogFile.txt

writer.policies = size:10
#writer.archiveFormat = /storage/emulated/0/Android/data/files/{#}archivedLog.txt
writer.archiveNumbering = DateAndSequence
writer.archiveDateFormat = yyyy-MM-dd
writer.maxArchiveFiles = 1000

Disable concurrent writes (if supported by your implementation)

writer.concurrentWrites = false

Define log format (optional)

writer.format = {date: HH:mm:ss.SSS} {class}.{method}() {level}: {message}

But the thing is now I can only see the last log in my myLogFile.txt and I do not find my previous logs, I am really confused regarding the where the previous logs are going.
And also I can see the tinyLogs implementation with Android API 34(using Kotlin), is too flaky.

Do help me with some suggestions.
Thanks

from tinylog.

siddhant123-geek avatar siddhant123-geek commented on September 24, 2024

Attaching the screenshot of my emulator file explorer -
Screenshot 2024-02-11 234421

from tinylog.

siddhant123-geek avatar siddhant123-geek commented on September 24, 2024

Hi @pmwmedia I have fixed everything, now my tinylog.properties looks something like this -
writer = rolling file
writer.directory = /storage/emulated/0/Android/data/com.palisisag.pitapp/files
writer.file = /storage/emulated/0/Android/data/com.palisisag.pitapp/files/archive/archivedLogFile_{count}.txt
#writer.latest = /storage/emulated/0/Android/data/com.palisisag.pitapp/files/myLogFile.txt
#writer.latest = {tinylog.directory}/log.txt
writer.policies = startup, daily: 00:00, size:100
#writer.archiveFormat = /storage/emulated/0/Android/data/com.palisisag.pitapp/files/archive/{#}.txt
#writer.archiveNumbering = DateAndSequence
writer.convert = gzip
#writer.archiveDateFormat = yyyy-MM-dd
writer.backups = 10
writer.concurrentWrites = false
writer.format = {date: HH:mm:ss.SSS} {class}.{method}() {level}: {message}

The only issue I am having is I want my writer.latest to point at the current log file outside the archive folder, but its giving me this warning -
LOGGER WARN: Cannot create link to latest log file on Android.
Any workaround for this one ?

from tinylog.

siddhant123-geek avatar siddhant123-geek commented on September 24, 2024

@pmwmedia Currently I moved the last file created inside the logger directory manually to the desired desctination, let me know if you have any other better method in mind.

from tinylog.

pmwmedia avatar pmwmedia commented on September 24, 2024

Android doesn't support hard links and there is no workaround. However, you will still find the latest log file in /storage/emulated/0/Android/data/com.palisisag.pitapp/files/archive/archivedLogFile_{count}.txt. It is the file with the highest count number.

from tinylog.

siddhant123-geek avatar siddhant123-geek commented on September 24, 2024

Sorry for the late response. Cool got it. So I think we have to manually do it by moving the last file outside the archived folders, as per my requirement.

from tinylog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.